Display Multiple Member Types Hierarchically Instead of Alphabetically

  • Participant
    Warren on #13178

    Hi, I am trying to use member types to display/match the user roles I have on my Discord server which are ordered based on hierarchy/position in the roles list. If its possible I would like to suggest a feature to set an order/hierarchy of member types when outputting the singular name in a for each function in the members-loop.

    Example of user in member directory with roles sorted alphabetically: https://i.imgur.com/rUaBArQ.png
    Example of how it should look: https://i.imgur.com/pv1Ei9e.png


  • Keymaster
    (BuddyDev Team)
    Posts: 22489
    Brajesh Singh on #13195

    Hi Warren,
    Welcome to BuddyDev forum and thank you for the suggestion.

    We will consider adding it in future. For now, I can assist you with the sorting.

    BuddyPress Member Types are just ‘terms’ and if you are on WordPress 4.9+ there is a hook available ‘wp_get_object_terms_args’ that allows us to modify the args for the retrieval of the terms.

    We can order by ‘name’, ‘slug’, ‘term_id’ and a few more options.

    Please let me know how do you want it to be ordered(based on which parameter) and I can assist with the code.


You must be logged in to reply to this topic.

This topic is: not resolved