Как можно поменять получение уведомления о новых комментариях, к своим статьям, с почты на тот же вывод в header в отдельный блок? Что-то мне подсказывает что не так уж сложно переделать, наверное при помощи
$curauth
Но моих знаний тут уже не хватает..
add_action( 'comment_post', 'author_new_comment_notify', 10, 2 );
function author_new_comment_notify( $comment_ID, $comment_approved ){
// выходим если комментарий не одобрен
//if( $comment_approved == 0 )
// return;
$comment = get_comment( $comment_ID );
$post = get_post( $comment->comment_post_ID );
$user = get_userdata( $post->post_author );
if( empty( $user->user_email ) )
return;
// сообщение
$message = 'Новый ответ к вашей записи: '. $post->post_title . "\r\n";
$message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
$message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n";
$message .= 'Текст ответа:' . "\r\n" . $comment->comment_content . "\r\n\r\n";
// Тема
$subject = '['.$_SERVER['HTTP_HOST'].'] Новый ответ к вашей записи.';
// заголовки
$headers = 'From: No Answer <noanswer@'. $_SERVER['HTTP_HOST'] .'>' . "\r\n";
@wp_mail( $user->user_email, $subject, $message, $headers );
}