0

I have a case where I have multiple Administrators. Not all of them want to be notified per email when there was a comment posted or is held for moderation.

The Settings > Discussion page only allows for the control of comment moderation emails for all Admins, not for selected ones. Responsible for the emails being send is this function: http://wpseek.com/wp_notify_moderator/

Within that function there is an array stored in a variable called $emails and the first value that is being stored is get_option('admin_email'). The second value (email) is that of the post author.

At the end of the function there are some filters one of which let's you modify the $emails array and so far I got the following. But this is not working, any ideas why?

// Don't email webmaster for comment moderation
add_filter( 'comment_moderation_recipients', 'pref_dont_email_webmaster', 10, 2 );
function pref_dont_email_webmaster( $emails, $comment_id ) {
    $webmaster_email = 'name@address.xmp';
    if ( $emails[0] == $webmaster_email )
        unset($emails[0]);
    return (array) $emails;
}
2

comment_moderation_recipients filter is not in wordpress 3.6.

check link : http://wpseek.com/wp_notify_moderator/ you will find following line.

WORDPRESS 3.7-ALPHA-25157
  • Oh, I just assumed it'd be available in 3.6 as well. Do you know of a way to accomplish the same for lteWP3.6? – Marc Wiest Sep 6 '13 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.