Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Showing random group members

@r-a-y

Keymaster

bp-dev.org references an outdated version of BuddyPress.

There currently does not appear to be a random parameter for the group members loop.

One way around this is by using BP_Groups_Member::get_all_for_group() combined with a regular members loop.

With BP_Groups_Member::get_all_for_group() (available in /bp-groups/bp-groups-classes.php). Pass your group ID and it will return an array. One of the items in the array is the member IDs. You could then randomize the IDs yourself to a regular members loop:
https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/

Could also experiment with the `type` parameter with the “random” argument.

Skip to toolbar