Changeset 5986 for trunk/bp-core/bp-core-cache.php
- Timestamp:
- 04/13/2012 04:31:42 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-cache.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-cache.php
r5683 r5986 55 55 function bp_update_meta_cache( $args = array() ) { 56 56 global $wpdb; 57 57 58 58 $defaults = array( 59 59 'object_ids' => array(), // Comma-separated list or array of item ids … … 66 66 $r = wp_parse_args( $args, $defaults ); 67 67 extract( $r ); 68 68 69 69 if ( empty( $object_ids ) || empty( $object_type ) || empty( $meta_table ) ) { 70 70 return false; 71 71 } 72 72 73 73 if ( empty( $cache_key_prefix ) ) { 74 74 $cache_key_prefix = $meta_table; 75 75 } 76 76 77 77 if ( empty( $object_column ) ) { 78 78 $object_column = $object_type . '_id'; … … 87 87 88 88 $cache = array(); 89 89 90 90 // Get meta info 91 91 $id_list = join( ',', $object_ids ); … … 108 108 } 109 109 } 110 110 111 111 foreach ( $object_ids as $id ) { 112 112 if ( ! isset($cache[$id]) ) 113 113 $cache[$id] = array(); 114 114 115 115 foreach( $cache[$id] as $meta_key => $meta_value ) { 116 116 wp_cache_set( $cache_key_prefix . '_' . $id . '_' . $meta_key, $meta_value, 'bp' );
Note: See TracChangeset
for help on using the changeset viewer.