Changeset 13904 for trunk/src/bp-core/bp-core-cache.php
- Timestamp:
- 06/04/2024 02:32:30 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-cache.php
r13890 r13904 65 65 delete_transient( 'bp_active_member_count' ); 66 66 } 67 add_action( 'bp_core_activated_user', 67 add_action( 'bp_core_activated_user', 'bp_core_clear_member_count_caches' ); 68 68 add_action( 'bp_core_process_spammer_status', 'bp_core_clear_member_count_caches' ); 69 add_action( 'bp_core_deleted_account', 70 add_action( 'bp_first_activity_for_member', 71 add_action( 'deleted_user', 69 add_action( 'bp_core_deleted_account', 'bp_core_clear_member_count_caches' ); 70 add_action( 'bp_first_activity_for_member', 'bp_core_clear_member_count_caches' ); 71 add_action( 'deleted_user', 'bp_core_clear_member_count_caches' ); 72 72 73 73 /** … … 93 93 94 94 // Bail if post ID is not a directory page. 95 if ( ! in_array( $post_id, $page_ids ) ) {95 if ( ! in_array( $post_id, $page_ids, true ) ) { 96 96 return; 97 97 } … … 134 134 } 135 135 136 $keys = array_merge( $keys, array( 137 'registration', 138 'avatar_default', 139 'tags_blog_id', 140 'sitewide_tags_blog', 141 'registration', 142 'fileupload_mask', 143 ) ); 144 145 if ( in_array( $option, $keys ) ) { 136 $keys = array_merge( 137 $keys, 138 array( 139 'registration', 140 'avatar_default', 141 'tags_blog_id', 142 'sitewide_tags_blog', 143 'registration', 144 'fileupload_mask', 145 ) 146 ); 147 148 if ( in_array( $option, $keys, true ) ) { 146 149 wp_cache_delete( 'root_blog_options', 'bp' ); 147 150 } … … 207 210 $args, 208 211 array( 209 'object_ids' 210 'object_type' 212 'object_ids' => array(), // Comma-separated list or array of item ids. 213 'object_type' => '', // Canonical component id: groups, members, etc. 211 214 'cache_group' => '', // Cache group. 212 'meta_table' 215 'meta_table' => '', // Name of the table containing the metadata. 213 216 'object_column' => '', // DB column for the object ids (group_id, etc). 214 217 'cache_key_prefix' => '', // Prefix to use when creating cache key names. Eg 'bp_groups_groupmeta'. … … 246 249 if ( ! empty( $meta_list ) ) { 247 250 foreach ( $meta_list as $metarow ) { 248 $mpid = intval( $metarow[ $object_column] );251 $mpid = intval( $metarow[ $object_column ] ); 249 252 $mkey = $metarow['meta_key']; 250 253 $mval = $metarow['meta_value']; 251 254 252 255 // Force subkeys to be array type. 253 if ( !isset( $cache[$mpid] ) || !is_array( $cache[$mpid] ) ) 254 $cache[$mpid] = array(); 255 if ( !isset( $cache[$mpid][$mkey] ) || !is_array( $cache[$mpid][$mkey] ) ) 256 $cache[$mpid][$mkey] = array(); 256 if ( ! isset( $cache[ $mpid ] ) || ! is_array( $cache[ $mpid ] ) ) { 257 $cache[ $mpid ] = array(); 258 } 259 if ( ! isset( $cache[ $mpid ][ $mkey ] ) || ! is_array( $cache[ $mpid ][ $mkey ] ) ) { 260 $cache[ $mpid ][ $mkey ] = array(); 261 } 257 262 258 263 // Add a value to the current pid/key. 259 $cache[ $mpid][$mkey][] = $mval;264 $cache[ $mpid ][ $mkey ][] = $mval; 260 265 } 261 266 } … … 345 350 function bp_core_get_incremented_cache_key( $key, $group ) { 346 351 $incrementor = bp_core_get_incrementor( $group ); 347 $cache_key = md5( $key . $incrementor );352 $cache_key = md5( $key . $incrementor ); 348 353 return $cache_key; 349 354 } … … 414 419 * @since 7.0.0 415 420 * 416 * @param int $type_id The Type's term ID.421 * @param int $type_id The Type's term ID. 417 422 * @param string $taxonomy The Type's taxonomy name. 418 423 */
Note: See TracChangeset
for help on using the changeset viewer.