如果你想将此电子邮件发送给多人,请在函数中使用以下代码。php-
function se_comment_moderation_recipients( $emails, $comment_id ) {
$comment = get_comment( $comment_id );
$post = get_post( $comment->comment_post_ID );
$emails = array();
// $users = array(set of user IDs t whome you want to send mails)
$users = array( 1, 16628, 15983 );
foreach($users as $uid){
$user = get_user_by( \'id\', $uid );
// Return emails of users .
if ( !empty( $user->user_email ) ) {
$emails[] = $user->user_email;
}
}
$emails_list = array(implode(",",$emails));
return $emails_list;
}
add_filter( \'comment_moderation_recipients\', \'se_comment_moderation_recipients\', 11, 2 );
add_filter( \'comment_notification_recipients\', \'se_comment_moderation_recipients\', 11, 2 );