Ticket #12774: 12774.diff
File 12774.diff, 2.0 KB (added by , 13 years ago) |
---|
-
wp-includes/pluggable.php
998 998 * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' 999 999 * @return bool False if user email does not exist. True on completion. 1000 1000 */ 1001 function wp_notify_postauthor($comment_id, $comment_type='') { 1002 $comment = get_comment($comment_id); 1003 $post = get_post($comment->comment_post_ID); 1004 $user = get_userdata( $post->post_author ); 1005 $moderating_user = wp_get_current_user(); 1006 $moderating_uid = (int) $user->id; 1001 function wp_notify_postauthor( $comment_id, $comment_type = '' ) { 1002 $comment = get_comment( $comment_id ); 1003 $post = get_post( $comment->comment_post_ID ); 1004 $author = get_userdata( $post->post_author ); 1007 1005 1006 // The comment was left by the author 1007 if ( $comment->user_id == $post->post_author ) 1008 return false; 1008 1009 1009 if ( $comment->user_id == $post->post_author ) return false; // The comment was left by the author.1010 1011 if ( $user->user_id == $moderating_uid ) return false; // The author moderated a comment on his own post1010 // The author moderated a comment on his own post 1011 if ( $post->post_author == get_current_user_id() ) 1012 return false; 1012 1013 1013 if ('' == $user->user_email) return false; // If there's no email to send the comment to 1014 // If there's no email to send the comment to 1015 if ( '' == $author->user_email ) 1016 return false; 1014 1017 1015 1018 $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); 1016 1019 … … 1080 1083 $subject = apply_filters('comment_notification_subject', $subject, $comment_id); 1081 1084 $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id); 1082 1085 1083 @wp_mail( $user->user_email, $subject, $notify_message, $message_headers);1086 @wp_mail( $author->user_email, $subject, $notify_message, $message_headers ); 1084 1087 1085 1088 return true; 1086 1089 }