Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#6378 closed enhancement (no action required)

bp_group_has_members ORDER BY

Reported by: baldgoat's profile baldgoat Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

I'd like to be able to modify the ORDER BY on the members returned by bp_group_has_members(), Either through the args array or adding a filter.

For example, order by role (admins, mods, members)

Potentially, an apply_filters on $sql could be added before this line in the get_group_members_ids method of the BP_Group_Member_Query class...

$this->group_member_ids = $wpdb->get_col( "{$sqlselect?} {$sqlwhere?} {$sqlorderby?} {$sqlorder?}" );

Change History (3)

#1 @boonebgorges
10 years ago

You should already be able to use the 'bp_pre_user_query' hook to do this.

BP_Group_Member_Query and bp_group_has_members() already supports a couple of built-in 'type' values - 'type' is basically a preset 'ORDER BY' clause. It supports: 'last_joined', 'first_joined', 'newest', 'active', 'online', 'random', 'popular', 'alphabetical'. If you can think of other sort orders that would be useful to build into BP, please feel free to make a suggestion.

#2 @DJPaul
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

#3 @DJPaul
9 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.