Changeset 16017 for trunk/wp-includes/meta.php
- Timestamp:
- 10/27/2010 05:45:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/meta.php
r15983 r16017 45 45 // expected_slashed ($meta_key) 46 46 $meta_key = stripslashes($meta_key); 47 $meta_value = stripslashes_deep($meta_value); 47 48 48 49 $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); … … 56 57 57 58 $_meta_value = $meta_value; 58 $meta_value = maybe_serialize( stripslashes_deep($meta_value));59 $meta_value = maybe_serialize( $meta_value ); 59 60 60 61 do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value ); … … 112 113 // expected_slashed ($meta_key) 113 114 $meta_key = stripslashes($meta_key); 115 $meta_value = stripslashes_deep($meta_value); 114 116 115 117 $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value ); … … 130 132 131 133 $_meta_value = $meta_value; 132 $meta_value = maybe_serialize( stripslashes_deep($meta_value));134 $meta_value = maybe_serialize( $meta_value ); 133 135 134 136 $data = compact( 'meta_value' ); … … 187 189 // expected_slashed ($meta_key) 188 190 $meta_key = stripslashes($meta_key); 189 $meta_value = maybe_serialize( stripslashes_deep($meta_value));191 $meta_value = stripslashes_deep($meta_value); 190 192 191 193 $check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all ); … … 193 195 return (bool) $check; 194 196 197 $_meta_value = $meta_value; 198 $meta_value = maybe_serialize( $meta_value ); 199 195 200 $query = $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s", $meta_key ); 196 201 … … 205 210 return false; 206 211 207 do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $ meta_value );212 do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value ); 208 213 209 214 $query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . " )"; … … 219 224 clean_user_cache($object_id); 220 225 221 do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $ meta_value );226 do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value ); 222 227 223 228 return true; … … 246 251 $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single ); 247 252 if ( null !== $check ) { 248 if ( !is_array( $check ) ) 253 if ( $single && is_array( $check ) ) 254 return $check[0]; 255 else 249 256 return $check; 250 elseif ( $single )251 return maybe_unserialize( $check[0] );252 else253 return array_map( 'maybe_unserialize', $check );254 257 } 255 258
Note: See TracChangeset
for help on using the changeset viewer.