Sorting users by alphabetical order
-
Hi there,
I always used the following code in my function.php file to display users alphabetically:
function sort_by_newest( $query ) {
global $pagenow;
if ( is_admin() && $pagenow == ‘users.php’ ) {
if ( ! isset( $_REQUEST[‘orderby’] ) ) {
$query->query_vars[“order”] = ‘desc’;
$query->query_orderby = ” ORDER BY user_nicename ” . ( $query->query_vars[“order”] == “asc” ? “desc ” : “asc ” ); //set sort order
}
}
return $query;
}This code overrides the UM function in class-admin-users.php file.
Unfortunately, it does not seem to work anymore after updating to version 2.0 of your plugin. How can I fix it? I need to display users in alphabetical order by default.Thank you!
- The topic ‘Sorting users by alphabetical order’ is closed to new replies.