From 563583c87b26670e4c8f461702eb41441e2186d2 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Apr 2009 20:55:04 +0000 Subject: [PATCH] Don't notify post author of own comments. Props Denis-de-Bernardy. fixes #8695 git-svn-id: https://develop.svn.wordpress.org/trunk@11057 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index a8a10cc1c4..70fddf1cea 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -938,6 +938,9 @@ 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 ); + $current_user = wp_get_current_user(); + + if ( $current_user->ID == $user->ID ) 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