Changeset 11074 for trunk/src/bp-groups/bp-groups-cache.php
- Timestamp:
- 09/09/2016 03:54:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-cache.php
r11072 r11074 275 275 add_action( 'deleted_group_meta', 'bp_groups_reset_cache_incrementor' ); 276 276 add_action( 'added_group_meta', 'bp_groups_reset_cache_incrementor' ); 277 278 /** 279 * Reset cache incrementor for Groups component when a group's taxonomy terms change. 280 * 281 * We infer that a group is being affected by looking at the objects belonging 282 * to the taxonomy being affected. 283 * 284 * @since 2.7.0 285 * 286 * @param int $object_id ID of the item whose terms are being modified. 287 * @param array $terms Array of object terms. 288 * @param array $tt_ids Array of term taxonomy IDs. 289 * @param string $taxonomy Taxonomy slug. 290 * @return bool True on success, false on failure. 291 */ 292 function bp_groups_reset_cache_incrementor_on_group_term_change( $object_id, $terms, $tt_ids, $taxonomy ) { 293 $tax_object = get_taxonomy( $taxonomy ); 294 if ( $tax_object && in_array( 'bp_group', $tax_object->object_type ) ) { 295 return bp_groups_reset_cache_incrementor(); 296 } 297 298 return false; 299 } 300 add_action( 'bp_set_object_terms', 'bp_groups_reset_cache_incrementor_on_group_term_change', 10, 4 ); 301 302 /** 303 * Reset cache incrementor for Groups component when a group's taxonomy terms are removed. 304 * 305 * We infer that a group is being affected by looking at the objects belonging 306 * to the taxonomy being affected. 307 * 308 * @since 2.7.0 309 * 310 * @param int $object_id ID of the item whose terms are being modified. 311 * @param array $terms Array of object terms. 312 * @param string $taxonomy Taxonomy slug. 313 * @return bool True on success, false on failure. 314 */ 315 function bp_groups_reset_cache_incrementor_on_group_term_remove( $object_id, $terms, $taxonomy ) { 316 $tax_object = get_taxonomy( $taxonomy ); 317 if ( $tax_object && in_array( 'bp_group', $tax_object->object_type ) ) { 318 return bp_groups_reset_cache_incrementor(); 319 } 320 321 return false; 322 } 323 add_action( 'bp_remove_object_terms', 'bp_groups_reset_cache_incrementor_on_group_term_remove', 10, 3 ); 277 324 278 325 /* List actions to clear super cached pages on, if super cache is installed */
Note: See TracChangeset
for help on using the changeset viewer.