Changeset 11999
- Timestamp:
- 10/06/2009 07:18:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/meta.php
r11996 r11999 82 82 83 83 function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false) { 84 if ( !$meta_type || !$meta_key || (!$delete_all && ! (int)$object_id) ) 85 return false; 86 87 if ( ! $table = _get_meta_table($meta_type) ) 88 return false; 89 90 global $wpdb; 91 84 if ( !$meta_type || !$meta_key || (!$delete_all && ! (int)$object_id) ) 85 return false; 86 87 if ( ! $table = _get_meta_table($meta_type) ) 88 return false; 89 90 global $wpdb; 91 92 $type_column = esc_sql($meta_type . '_id'); 92 93 // expected_slashed ($meta_key) 93 94 $meta_key = stripslashes($meta_key); … … 97 98 98 99 if ( !$delete_all ) 99 $query .= $wpdb->prepare(" AND %s = %d", $meta_type . '_id', $object_id );100 $query .= $wpdb->prepare(" AND $type_column = %d", $object_id ); 100 101 101 102 if ( $meta_value )
Note: See TracChangeset
for help on using the changeset viewer.