Skip to:
Content

BuddyPress.org

Changeset 7844


Ignore:
Timestamp:
02/11/2014 04:51:45 AM (6 years ago)
Author:
boonebgorges
Message:

Bust group object cache when updating groupmeta

This is important because some group metadata gets stored with the group
object (like last activity)

See #4551

File:
1 edited

Legend:

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

    r7843 r7844  
    7474
    7575/**
     76 * Bust group cache when modifying metadata.
     77 *
     78 * @since BuddyPress (2.0.0)
     79 */
     80function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
     81    wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users', 'bp' );
     82    wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users', 'bp' );
     83}
     84add_action( 'updated_group_meta', 'bp_groups_delete_group_cache_on_metadata_change', 10, 2 );
     85add_action( 'added_group_meta', 'bp_groups_delete_group_cache_on_metadata_change', 10, 2 );
     86
     87/**
    7688 * Clear caches for the group creator when a group is created.
    7789 *
Note: See TracChangeset for help on using the changeset viewer.