WordPress.org

Make WordPress Core

Ticket #1263: bug1263_pluggable-functions2.php

File bug1263_pluggable-functions2.php, 1010 bytes (added by coffee2code, 16 years ago)
Line 
1Index: wp-includes/pluggable-functions.php
2===================================================================
3--- wp-includes/pluggable-functions.php (revision 2557)
4+++ wp-includes/pluggable-functions.php (working copy)
5@@ -173,8 +173,12 @@
6     
7        $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
8        $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
9+       $currentuser = get_userdata($comment->user_id);
10+
11+       // Don't notify admin or post_author about their own comment
12+       if ( $currentuser && ($post->post_author == $currentuser->ID || $currentuser->user_level >= 9) ) return false;
13+
14        $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");
15-
16        if ('' == $user->user_email) return false; // If there's no email to send the comment to
17 
18        $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
19@@ -266,4 +270,4 @@
20 }
21 endif;
22 
23-?>
24\ No newline at end of file
25+?>