Sending comment notifications to different recipients depending on taxonomy terms
Finally I found the right code, if it can be usefull to someone: function sp_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); if ( has_term(‘myterm’,’mytaxonomy’, $post->ID) ) { return array( ‘[email protected]’ ); } return $emails; } add_filter( ‘comment_moderation_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 ); add_filter( ‘comment_notification_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 );