Changeset 15983 for trunk/wp-includes/meta.php
- Timestamp:
- 10/26/2010 07:11:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/meta.php
r15917 r15983 46 46 $meta_key = stripslashes($meta_key); 47 47 48 $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); 49 if ( null !== $check ) 50 return (bool) $check; 51 48 52 if ( $unique && $wpdb->get_var( $wpdb->prepare( 49 53 "SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d", … … 108 112 // expected_slashed ($meta_key) 109 113 $meta_key = stripslashes($meta_key); 114 115 $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value ); 116 if ( null !== $check ) 117 return (bool) $check; 110 118 111 119 if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) ) … … 181 189 $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); 182 190 191 $check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all ); 192 if ( null !== $check ) 193 return (bool) $check; 194 183 195 $query = $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s", $meta_key ); 184 196 … … 232 244 return false; 233 245 246 $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single ); 247 if ( null !== $check ) { 248 if ( !is_array( $check ) ) 249 return $check; 250 elseif ( $single ) 251 return maybe_unserialize( $check[0] ); 252 else 253 return array_map( 'maybe_unserialize', $check ); 254 } 255 234 256 $meta_cache = wp_cache_get($object_id, $meta_type . '_meta'); 235 257 … … 239 261 } 240 262 241 if ( ! 263 if ( !$meta_key ) 242 264 return $meta_cache; 243 265
Note: See TracChangeset
for help on using the changeset viewer.