Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2021 02:01:40 PM (4 years ago)
Author:
espellcaste
Message:

Improving the group member count routine and the function helper.

The group member count routine was updated to avoid direct, uncached, SQL query and unnecessary cache refresh when a group's Members page was viewed.

is now being used to get the group member count which takes into account users' existence in the site,

the query is now cached and filterable.

was also updated to get the current group from if available.

Props imath
Fixes #7614 and see #6749

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/screens/single/members.php

    r11923 r13103  
    1515function groups_screen_group_members() {
    1616
    17     if ( !bp_is_single_item() )
     17    if ( ! bp_is_single_item() ) {
    1818        return false;
     19    }
    1920
    2021    $bp = buddypress();
    21 
    22     // Refresh the group member count meta.
    23     groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
    2422
    2523    /**
Note: See TracChangeset for help on using the changeset viewer.