#6378 closed enhancement (no action required)
bp_group_has_members ORDER BY
Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
You should already be able to use the
'bp_pre_user_query'
hook to do this.BP_Group_Member_Query
andbp_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.