From 9dc38817158619c0869c0a070c3d92430aea649d Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 5 Dec 2005 05:31:27 +0000 Subject: [PATCH] Decrease comment count only when deleting approved comments. git-svn-id: http://svn.automattic.com/wordpress/trunk@3271 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index 5f52018c86..3bafa8ce88 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -201,7 +201,7 @@ function wp_delete_comment($comment_id) { return false; $post_id = $comment->comment_post_ID; - if ( $post_id ) + if ( $post_id && $comment->comment_approved == 1 ) $wpdb->query( "UPDATE $wpdb->posts SET comment_count = comment_count - 1 WHERE ID = '$post_id'" ); do_action('wp_set_comment_status', $comment_id, 'delete');