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 = '[email protected]';
if ( $emails[0] == $webmaster_email )
unset($emails[0]);
return (array) $emails;
}
wp_notify_moderator()
this helped me.