Skip to:
Content

Changeset 6611


Ignore:
Timestamp:
12/10/12 15:10:00 (16 months ago)
Author:
johnjamesjacoby
Message:

Delete single group caches when updating or deleting. Fixes #4572.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-cache.php

    r6342 r6611  
    4949add_action( 'groups_group_avatar_updated',       'groups_clear_group_object_cache' ); 
    5050add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' ); 
     51 
     52/** 
     53 * Bust group caches when editing or deleting 
     54 * 
     55 * @since BuddyPress (1.7) 
     56 * @param int $group_id The group being edited 
     57 */ 
     58function bp_groups_delete_group_cache( $group_id = 0 ) { 
     59    wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users'   ); 
     60    wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users' ); 
     61} 
     62add_action( 'groups_delete_group',     'bp_groups_delete_group_cache' ); 
     63add_action( 'groups_update_group',     'bp_groups_delete_group_cache' ); 
     64add_action( 'groups_details_updated',  'bp_groups_delete_group_cache' ); 
     65add_action( 'groups_settings_updated', 'bp_groups_delete_group_cache' ); 
    5166 
    5267/** 
Note: See TracChangeset for help on using the changeset viewer.