From f57354bf63e09941efb17794b059b89dd530b0cf Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 28 May 2008 15:37:59 +0000 Subject: [PATCH] Fix duplicate comment notifications. Props MtDewVirus. fixes #6892 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8004 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/comment.php | 6 +----- wp-includes/comment.php | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index a1771d371..d1e394ea9 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -193,10 +193,6 @@ case 'approvecomment' : wp_set_comment_status( $comment->comment_ID, 'approve' ); - if ( true == get_option('comments_notify') ) - wp_notify_postauthor( $comment->comment_ID ); - - if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else @@ -229,4 +225,4 @@ default: include('admin-footer.php'); -?> \ No newline at end of file +?> diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 852d23207..bf784f56b 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -734,8 +734,10 @@ function wp_set_comment_status($comment_id, $comment_status) { break; case 'approve': $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id); - if ( get_option( 'comments_notify' ) == true ) - wp_notify_postauthor( $comment_id ); + if ( get_option('comments_notify') ) { + $comment = get_comment($comment_id); + wp_notify_postauthor($comment_id, $comment->comment_type); + } break; case 'spam': $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);