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
+1 -1
View File
@@ -489,7 +489,7 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) {
do_action( 'delete_postmeta', $meta_id );
// Run the query, will return true if deleted, false otherwise
$result = (bool) $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE $id_column = %d LIMIT 1;", $meta_id ) );
$result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) );
// Clear the caches.
wp_cache_delete($object_id, $meta_type . '_meta');