Sending comment notifications to different recipients depending on taxonomy terms
I try to add a filter to the comment notification recipients function, for adding different recipients/moderators depending on the taxonomy terms of each post.
This is my code so far, but it doesn't work:
function se_comment_moderation_recipients( $emails, $comment_id ) {
$emails = array( '[email protected]' );
if ( has_term('myterm','mytaxonomy') )
return $emails;
}
add_filter( 'comment_moderation_recipients', 'se_comment_moderation_recipients', 11, 2 );
add_filter( 'comment_notification_recipients', 'se_comment_moderation_recipients', 11, 2 );
Any help would be really really appreciate.
Topic terms notifications comments moderation Wordpress
Category Web