Answer the question
In order to leave comments, you need to log in
Sorting users alphabetically in the admin how to do it on Wordpress?
Tell me how to sort users alphabetically in the admin panel? Is this done by adding a dropdown list, or is a plugin needed rather? If a plugin, which one?
Answer the question
In order to leave comments, you need to log in
You can fix the parameters of the global user request on the hookpre_get_users
add_action( 'pre_get_users', 'custom_pre_get_users', 1 );
function custom_pre_get_users( $query ) {
if ( is_admin() && $query->is_main_query() )
$query->set( 'orderby', 'nicename' );
}
In alphanumeric order, users are already displayed by default in the admin panel.
If you just need to sort in every possible way by different user meta values, then the plugin https://wordpress.org/plugins/amr-users/ will do .
If you want to manually customize the output, then there is a guide with code: https://www.minddevelopmentanddesign.com/blog/how-...
However, it shows how to switch to numeric sorting instead of alphabetical. But the idea must be clear.
and how to configure the output not alphabetically but by the date of registration? who cares about the alphabetical output for users? It's always interesting who's new registered ... and preferably without additional. plugins...
add_action( 'pre_get_users', 'custom_pre_get_users', 1 );
function custom_pre_get_users( $query ) {
if ( is_admin() && $query->is_main_query() )
$query->set( 'orderby', 'registered' );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question