Don't fire wp_notify_postauthor() when the author moderated the comment. Props mrmist. fixes #12774

git-svn-id: http://svn.automattic.com/wordpress/trunk@16208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-11-05 15:36:04 +00:00
parent dbf7388c5b
commit 98c65bd2f7
1 changed files with 6 additions and 1 deletions

View File

@ -1002,8 +1002,13 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$comment = get_comment($comment_id);
$post = get_post($comment->comment_post_ID);
$user = get_userdata( $post->post_author );
$moderating_user = wp_get_current_user();
$moderating_uid = (int) $user->id;
if ( $comment->user_id == $post->post_author ) return false; // The author moderated a comment on his own post
if ( $comment->user_id == $post->post_author ) return false; // The comment was left by the author.
if ( $user->user_id == $moderating_uid ) return false; // The author moderated a comment on his own post
if ('' == $user->user_email) return false; // If there's no email to send the comment to