Sort user tables in WordPress admin
With a request to sort users by recently registered. This feature was useful because the site was using s2member and has more than a thousand users. Troubleshooting new users are easier this way.
Code Markup
function wp_users_list_table_query_args( $args ) {
if ( empty( $args['orderby'] ) )
$args['orderby'] = 'user_registered';
if ( empty( $args['order'] ) )
$args['order'] = 'ASC';
return $args;
}
add_filter( 'users_list_table_query_args', 'wp_users_list_table_query_args' );