Skip to:
Content

BuddyPress.org

Changeset 13129


Ignore:
Timestamp:
10/21/2021 06:02:52 PM (3 months ago)
Author:
imath
Message:

Avoid using legacy args with groups_get_group_members()

Instead of using the 'exclude_banned' and/or 'exclude_admins_mods' args, it's best to use the 'group_role' argument & pass the list of roles to include in the count (in this case all roles except the banned one).

See #7614

File:
1 edited

Legend:

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

    r13108 r13129  
    17821782            $members = groups_get_group_members(
    17831783                array(
    1784                     'group_id'            => $group_id,
    1785                     'exclude_banned'      => true,
    1786                     'exclude_admins_mods' => false,
    1787                     'type'                => 'active',
     1784                    'group_id'   => $group_id,
     1785                    'group_role' => array( 'member', 'admin', 'mod' ),
     1786                    'type'       => 'active',
    17881787                )
    17891788            );
Note: See TracChangeset for help on using the changeset viewer.