Decrease comment count only when deleting approved comments.
git-svn-id: https://develop.svn.wordpress.org/trunk@3271 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
35dcc72e9b
commit
94bc2195d4
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user