Fix notice without breaking comment notifications. See r13150, see #11830

git-svn-id: http://svn.automattic.com/wordpress/trunk@13801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-03-22 16:06:55 +00:00
parent 59c4af548b
commit 308c876d27
1 changed files with 1 additions and 1 deletions

View File

@ -1274,7 +1274,7 @@ function wp_new_comment( $commentdata ) {
$post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
if ( isset( $commentdata['user_id'] ) && get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_id'] )
if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) )
wp_notify_postauthor($comment_ID, $commentdata['comment_type']);
}