Answer the question
In order to leave comments, you need to log in
How to get an array of users with the number of articles each has?
Now I do this:
// Массив всех пользователей
$users = get_users( array(
'meta_key' => '_cms_user_rating',
'orderby' => 'meta_value_num',
'order' => 'DESC',
) );
// Количество записей для каждого пользователя
$counts = count_many_users_posts(array_map(function($u){return $u->ID;}, $users));
Answer the question
In order to leave comments, you need to log in
Getting a list of users is not a problem. Where is the article itself located and how is it determined who the author of the article is?
So you need a SQL query, or ready-made code???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question