I
I
id_baton4eg2020-10-28 13:25:02
SQL
id_baton4eg, 2020-10-28 13:25:02

WP User Query - how to get sequence number?

Good afternoon,
I'm using the wp_user_query() class with sorting by numeric meta field to get a list of users in the correct order.
Prompt, how it is possible to receive serial number of the current user avoiding a cycle?
The second day I'm puzzling over this question - in fact, it's not a problem to do this in a cycle

$i++; 
if(get_current_user_id() == user->ID) {
 echo $i; 
}

but I don't like this option, I'm sure there are more productive solutions :)
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question