Notifications
Clear all

[Solved] Disable Editor Moderation

3 Posts
2 Users
1 Reactions
856 Views
Posts: 4
 DB
Customer
Topic starter
(@dale-bock)
Member
Joined: 3 years ago

Is possible to only allow Administrators to moderate comments via the frontend moderation tool? We allow editors to modify their posts, but don't want to allow them to modify or delete comments from other users. Currently, I need to toggle the plugin on/off whenever it needs to be used by an admin.

2 Replies
Astghik
Posts: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

@dale-bock,

Please use the hook code below:

global $wpDiscuzFrontEndModeration;
    if (function_exists('wpDiscuz') && $wpDiscuzFrontEndModeration && !current_user_can("manage_options")) {
        remove_action("wpdiscuz_comment_buttons", [&$wpDiscuzFrontEndModeration, "addButtons"], 13, 4);
        remove_action("wpdiscuz_filtering_buttons", [&$wpDiscuzFrontEndModeration, "filterButton"], 13, 2);
        remove_action("wp_ajax_wfem_move_comment", [&$wpDiscuzFrontEndModeration, "moveComment"], 13);
        remove_action("wp_ajax_wfem_post_titles", [&$wpDiscuzFrontEndModeration, "postTitles"], 13);
        remove_action("wpdiscuz_comment_buttons", [&$wpDiscuzFrontEndModeration, "addButtons"], 13, 4);
        remove_action("wp_ajax_wfem_blacklist", [&$wpDiscuzFrontEndModeration, "setToBlacklist"], 13);
        remove_action("wpdiscuz_comments_args", [&$wpDiscuzFrontEndModeration, "commentArguments"], 13);
        remove_action("wp_ajax_wfem_moderate", [&$wpDiscuzFrontEndModeration, "responseToModeration"], 13);
        remove_filter("wpdiscuz_filter_args", [&$wpDiscuzFrontEndModeration, "filterArgs"], 13);
        remove_filter("wpdiscuz_js_options", [&$wpDiscuzFrontEndModeration, "moderateScriptArray"], 13);
        remove_action("wp_ajax_wfem_delete", [&$wpDiscuzFrontEndModeration, "deleteComment"], 13);
        remove_action("wp_ajax_wfem_email", [&$wpDiscuzFrontEndModeration, "sendMail"], 13);
    }

Put the code in the WordPress active theme functions.php file. This article should be helpful for you: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

Posts: 4
 DB
Customer
Topic starter
(@dale-bock)
Member
Joined: 3 years ago

Thank you! We added it to our functions.php file and it fixed the problem for us.

Share:
Scroll to top