Support » Plugin: Simple User Listing » Alphabatize First Names

  • I just noticed in a very large listing of users, that they are ordered by first names (A’s are together, B’s are together, etc.), but the names in those groups are not in alphabetical order.

    For example:

    Angie
    Ashley
    Amelia
    Anthony

    My list parameter is a basic one with meta_key and a meta_value. I’ve tried using order ASC, but that doesn’t affect the list.

    What am I doing wrong?

    Thank you!

    https://wordpress.org/plugins/simple-user-listing/

Viewing 1 replies (of 1 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    By default WordPress orders the WP_Query_User by the login name. Always refer to the Codex as SUL really is only a shortcode “wrapper” for WP_Query_User.

    Also, ordering by a meta key is covered in the SUL FAQ. See the section on ordering by the last name.

    If you want to order by your custom meta field then you need to orderby="meta_key" to the shortcode.

    If you want to show the data by your custom meta field and then order by first name, then you will need to write your own custom meta query. Again, look at the Codex. You can either filter sul_user_query_args or pre_user_query. SUL doesn’t support that out of the box. It is flexible enough to allow you to do it, but I don’t have any examples of this and don’t provide support for that level of customization.

Viewing 1 replies (of 1 total)
  • The topic ‘Alphabatize First Names’ is closed to new replies.