Send Comment Moderation Emails to Editors
Sends "please moderate" comment emails to every editor as well as the site admin, so comments are approved faster.
Opens WPIDE on
Code
add_filter( 'comment_moderation_recipients', function ( $emails ) {
$editors = get_users( array( 'role' => 'editor', 'fields' => array( 'user_email' ) ) );
return array_values( array_unique( array_merge( (array) $emails, wp_list_pluck( $editors, 'user_email' ) ) ) );
} );
Notes
Editors must have an email address on their profile.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.