From 20131f4e62397c3e32bfcd81b0856ff8f83982e6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 5 Nov 2010 15:36:04 +0000 Subject: [PATCH] Don't fire wp_notify_postauthor() when the author moderated the comment. Props mrmist. fixes #12774 git-svn-id: https://develop.svn.wordpress.org/trunk@16208 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index d444adc5b5..b6f1b9310d 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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