diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 9e7ea94ac6..acfa2ddd77 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -989,10 +989,6 @@ function wp_notify_postauthor( $comment_id, $comment_type = '' ) { $post = get_post( $comment->comment_post_ID ); $author = get_userdata( $post->post_author ); - // The post author is no longer a member of the blog - if ( ! is_user_member_of_blog( $post->post_author ) ) - return false; - // The comment was left by the author if ( $comment->user_id == $post->post_author ) return false; @@ -1001,6 +997,10 @@ function wp_notify_postauthor( $comment_id, $comment_type = '' ) { if ( $post->post_author == get_current_user_id() ) return false; + // The post author is no longer a member of the blog + if ( ! user_can( $post->post_author, 'read_post', $post->ID ) ) + return false; + // If there's no email to send the comment to if ( '' == $author->user_email ) return false; @@ -1045,11 +1045,14 @@ function wp_notify_postauthor( $comment_id, $comment_type = '' ) { } $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; $notify_message .= sprintf( __('Permalink: %s'), get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n"; - if ( EMPTY_TRASH_DAYS ) - $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; - else - $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; - $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; + + if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) { + if ( EMPTY_TRASH_DAYS ) + $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; + else + $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; + $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; + } $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));