The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
✦
✦
✦
AI is analyzing the discussion...
How-to and Troubleshooting
(@jon62)
Posts: 2
New Member
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
[#6664]
Hi !
I want to use WPDISCUZ as customer reviews. For that I would like that only, the administrator of the site or a user in particular, can answer the comments of the customers how to make please?
Posted : 07/02/2023 1:58 am
(@asti)
Posts: 8259
Illustrious Member Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
@jon62,
Use the hook code below:
add_filter('wpdiscuz_comment_list_args',function($args){
$current_user = wp_get_current_user();
$current_user_roles = (array)$current_user->roles;
if($args['can_user_reply'] && !in_array('administrator', $current_user_roles)){
if(!in_array('role_name', $current_user_roles)){
$args['can_user_reply'] = false;
}
}
return $args;
});
add_filter('preprocess_comment', function($commentdata){
$current_user = wp_get_current_user();
$current_user_roles = (array)$current_user->roles;
if($commentdata['comment_parent'] && !in_array('administrator', $current_user_roles)){
if(!in_array('role_name', $current_user_roles)){
wp_die('You don\'t have permission to comment.');
}
}
return $commentdata;
});
For administrators, the code works fine.
You should change the red marked value for the particular user role who should be able to reply.
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Posted : 08/02/2023 1:24 pm
(@jon62)
Posts: 2
New Member
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Hi !
Thank you for your feedback, where to place the code please
Posted : 09/02/2023 4:26 pm
(@asti)
Posts: 8259
Illustrious Member Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
@jon62,
In the active theme functions.php file.
This article should be helpful for you: https://themeisle.com/blog/php-in-wordpress/
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Posted : 09/02/2023 4:30 pm
(@asti)
Posts: 8259
Illustrious Member Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
We have not received a reply from you for over a couple of weeks, therefore we will be closing this topic. Please create a new one if you require any additional help.
Thank You!
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Posted : 21/02/2023 3:36 pm
Super Globals
Options and Features