mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-11 10:59:07 +01:00
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:
parent
7ff17cba43
commit
365a7b5ee0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user