Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2021 02:01:40 PM (3 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/classes/class-bp-groups-list-table.php

    r12788 r13103  
    702702     *
    703703     * @since 1.7.0
     704     * @since 10.0.0 Updated to use `groups_get_total_member_count`.
    704705     *
    705706     * @param array $item Information about the current row.
    706707     */
    707708    public function column_members( $item = array() ) {
    708         $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
     709        $count = groups_get_total_member_count( absint( $item['id'] ) );
    709710
    710711        /**
Note: See TracChangeset for help on using the changeset viewer.