Fix duplicate comment notifications. Props MtDewVirus. fixes #6892 for 2.5

git-svn-id: http://svn.automattic.com/wordpress/branches/2.5@8005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-28 15:42:04 +00:00
parent 7c49067a7c
commit 13c775003b
2 changed files with 6 additions and 7 deletions

View File

@ -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');
?>
?>

View File

@ -726,8 +726,11 @@ function wp_set_comment_status($comment_id, $comment_status) {
break;
case 'approve':
$query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
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 = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";