Wordpress user search query order by most recent login -
i'm creating custom user search results page , order results a) post_count (easily done) b) when user last logged in - i.e. active users.
is possible? there user meta field in db login date?
this have far:
$args = array( 'number' => $users_per_page, 'paged' => $current_page );
thanks.
figured out answer this. found meta key last_activity
.
$args = array( 'order' => 'desc', 'orderby' => 'last_activity', 'number' => $users_per_page, 'paged' => $current_page );
Comments
Post a Comment