Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948.

git-svn-id: https://develop.svn.wordpress.org/trunk@20287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-03-24 15:24:31 +00:00
parent 2a020b2d93
commit 54a6a40533
11 changed files with 72 additions and 25 deletions

View File

@@ -988,7 +988,7 @@ function wp_delete_comment($comment_id, $force_delete = false) {
do_action( 'deleted_commentmeta', $meta_ids );
}
if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
if ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment_id ) ) )
return false;
do_action('deleted_comment', $comment_id);