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
This commit is contained in:
parent
2628a27ef4
commit
2ef647c04f
@ -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