Order of search results based off of a backend custom field and also in alpha order
Surname is already stored as user meta last_name so you don’t need a custom field. You do need to make sure you’re only affecting the page you want to. function sort_users_by_lastname( $query ) { // only if we’re on users.php // and when orderby isn’t changed. the default (when nothing is set) is “login” $screen … Read more