From 365a7b5ee0152eba7cc3f45b96045bea0ec5ccf3 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@3366 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;