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
This commit is contained in:
ryan 2005-12-28 00:42:42 +00:00
parent 7ff17cba43
commit 365a7b5ee0
1 changed files with 1 additions and 1 deletions

View File

@ -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;