Skip to:
Content

BuddyPress.org

Changeset 7980


Ignore:
Timestamp:
02/25/2014 01:43:34 PM (10 years ago)
Author:
boonebgorges
Message:

Exclude 'last_activity' and 'total_member_count' from the bp_groups item cache

These items are stored in groupmeta, and thus are cached independently.
Furthermore, including them in the group cache will require that cache to be
busted more frequently than necessary.

See #5407

File:
1 edited

Legend:

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

    r7976 r7980  
    207207        if ( ! empty( $this->args['populate_extras'] ) ) {
    208208
    209             // Set up some specific group vars from meta
    210             $this->last_activity      = groups_get_groupmeta( $this->id, 'last_activity'      );
    211             $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
    212 
    213209            // Get group admins and mods
    214210            $admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) );
     
    225221            // Cache the group object before user-specific data is added
    226222            wp_cache_set( $this->id, $this, 'bp_groups' );
     223
     224            // Set up some specific group vars from meta. Excluded
     225            // from the bp_groups cache because it's cached independently
     226            $this->last_activity      = groups_get_groupmeta( $this->id, 'last_activity' );
     227            $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
    227228
    228229            // Set user-specific data
Note: See TracChangeset for help on using the changeset viewer.