Skip to:
Content
Pages
Categories
Search
Top
Bottom

Better sorting for new bp_group_has_members() query

  • Avatar of aaclayton
    aaclayton
    Participant

    @aaclayton

    Since 1.8, the new bp_group_has_members() query is working great, but I do have one concern with this new approach. Previously, bp_group_has_members() sorted group members based on their join date (‘last_modified’ in the bp_groups_members table). After the update, the query is sorting based on ‘user_id’ instead.

    It would be really great to have some sorting options added to bp_groups_has_members() in the future. I would propose that this function accept “type” and “sort” arguments, where “type” could take values of either ‘user_id’ or ‘last_modified’, and “sort” would be either ‘ASC’ or ‘DESC’.

    From an organizational perspective, a group member’s join date is (typically) a more informative sorting variable, and depending on the use case, either ascending OR descending could make more sense. Giving BuddyPress users the ability to tweak their loop sorting in the function would be great.

    Hope this is feedback that could be implemented. Thank you!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.