Changeset 10356 for trunk/src/bp-core/bp-core-cache.php
- Timestamp:
- 11/15/2015 07:57:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-cache.php
r10108 r10356 134 134 * @param array $item_ids ID list. 135 135 * @param string $cache_group The cache group to check against. 136 *137 136 * @return array 138 137 */ … … 175 174 * cache key names. Default: the value of $meta_table. 176 175 * } 177 *178 176 * @return array|bool Metadata cache for the specified objects, or false on failure. 179 177 */ … … 182 180 183 181 $defaults = array( 184 'object_ids' => array(), // Comma-separated list or array of item ids 185 'object_type' => '', // Canonical component id: groups, members, etc 186 'cache_group' => '', // Cache group 187 'meta_table' => '', // Name of the table containing the metadata 188 'object_column' => '', // DB column for the object ids (group_id, etc) 189 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg 'bp_groups_groupmeta' 182 'object_ids' => array(), // Comma-separated list or array of item ids. 183 'object_type' => '', // Canonical component id: groups, members, etc. 184 'cache_group' => '', // Cache group. 185 'meta_table' => '', // Name of the table containing the metadata. 186 'object_column' => '', // DB column for the object ids (group_id, etc). 187 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg 'bp_groups_groupmeta'. 190 188 ); 191 189 $r = wp_parse_args( $args, $defaults ); … … 213 211 $cache = array(); 214 212 215 // Get meta info 213 // Get meta info. 216 214 if ( ! empty( $uncached_ids ) ) { 217 215 $id_list = join( ',', wp_parse_id_list( $uncached_ids ) ); … … 224 222 $mval = $metarow['meta_value']; 225 223 226 // Force subkeys to be array type :224 // Force subkeys to be array type. 227 225 if ( !isset( $cache[$mpid] ) || !is_array( $cache[$mpid] ) ) 228 226 $cache[$mpid] = array(); … … 230 228 $cache[$mpid][$mkey] = array(); 231 229 232 // Add a value to the current pid/key :230 // Add a value to the current pid/key. 233 231 $cache[$mpid][$mkey][] = $mval; 234 232 } … … 236 234 237 235 foreach ( $uncached_ids as $uncached_id ) { 238 // Cache empty values as well 236 // Cache empty values as well. 239 237 if ( ! isset( $cache[ $uncached_id ] ) ) { 240 238 $cache[ $uncached_id ] = array();
Note: See TracChangeset
for help on using the changeset viewer.