One way to set the default order to: registration date, descending
-
Thanks for this very useful plugin! I saw a couple of earlier inquiries asking how to set the default view to the most recent registrations. Although the plugin support’s current “resolved” answer is “not possible,” I did find a code snippet that neatly did the trick. Maybe it can be added to the plugin down the road.
With many thanks to Thomas Griffin, I just added the snippet below to my child theme’s functions.php file:
add_action( 'pre_user_query', 'tgm_order_users_by_date_registered' ); function tgm_order_users_by_date_registered( $query ) { global $pagenow; if ( ! is_admin() || 'users.php' !== $pagenow ) { return; } $query->query_orderby = 'ORDER BY user_registered DESC'; }
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘One way to set the default order to: registration date, descending’ is closed to new replies.