群组成员循环

群组成员循环

Codex Home → Developer Resources → Loops Reference → Group Members Loop
Group Members Loop

The group members loop can be used to display members that have joined a group. It can be used nested inside the bp_has_groups() loop, or on its own with a group_id parameter.
Standard Loop

This group has no members.

Accepted Parameters
The bp_group_has_members() function will accept a number of parameters that will manipulate the data being returned.

group_id required
The ID of the group to fetch members for. Required when either: outside of the normal BuddyPress groups URL (/group/i-love-bp/members/) or not nested within a bp_has_groups() loop.

Default value: false

per_page optional
The number of members to display on a page before they are paginated to the next page.

Default value: 10

max optional
The total number of members to return.

Default value: false (no limit)

exclude_admins_mods optional
If you set this to true, only users with normal access (not a group administrator or moderator) will be returned in the members list.

Default value: true

exclude_banned optional
If you set this to true, any users that are banned from the group will not be returned in the members list.

Default value: true

Advanced Usage
Fetch all the members from the group with ID 15 and show 10 per page.

上次修改 2021.12.31