Changeset 16596
- Timestamp:
- 11/26/2010 09:35:26 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/meta.php
r16437 r16596 260 260 261 261 if ( !$meta_cache ) { 262 update_meta_cache($meta_type, $object_id);263 $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');262 $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); 263 $meta_cache = $meta_cache[$object_id]; 264 264 } 265 265 … … 310 310 $cache_key = $meta_type . '_meta'; 311 311 $ids = array(); 312 $cache = array(); 312 313 foreach ( $object_ids as $id ) { 313 if ( false === wp_cache_get($id, $cache_key) ) 314 $cached_object = wp_cache_get( $id, $cache_key ); 315 if ( false === $cached_object ) 314 316 $ids[] = $id; 317 else 318 $cache[$id] = $cached_object; 315 319 } 316 320 317 321 if ( empty( $ids ) ) 318 return false;322 return $cache; 319 323 320 324 // Get meta info 321 325 $id_list = join(',', $ids); 322 $cache = array();323 326 $meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)", 324 327 $meta_type), ARRAY_A ); … … 344 347 if ( ! isset($cache[$id]) ) 345 348 $cache[$id] = array(); 346 } 347 348 foreach ( array_keys($cache) as $object) 349 wp_cache_add($object, $cache[$object], $cache_key); 349 wp_cache_add( $id, $cache[$id], $cache_key ); 350 } 350 351 351 352 return $cache; -
trunk/wp-includes/user.php
r16497 r16596 1038 1038 $objects[$id] = array(); 1039 1039 1040 update_meta_cache('user', $ids); 1041 1042 foreach ( $ids as $id ) { 1043 $meta = get_metadata('user', $id); 1040 $metas = update_meta_cache('user', $ids); 1041 1042 foreach ( $metas as $id => $meta ) { 1044 1043 foreach ( $meta as $key => $metavalues ) { 1045 1044 foreach ( $metavalues as $value ) {
Note: See TracChangeset
for help on using the changeset viewer.