mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user