From 2ef647c04f9f2d511b83865f78e6c7f4d34ca988 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 28 Dec 2005 00:42:42 +0000 Subject: [PATCH] Use API to delete comment so that counts are kept in sync. Props Mike Little. fixes #2159 git-svn-id: https://develop.svn.wordpress.org/trunk@3366 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index b13c7f1560..74c4aeeee4 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -44,7 +44,7 @@ if ( !empty( $_POST['delete_comments'] ) ) : $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); if ( current_user_can('edit_post', $post_id) ) : - $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment"); + wp_set_comment_status($comment, "delete"); ++$i; endif; endforeach;