Codex tools: Log in
Contents |
Returns the post counts for a list of user IDs. This is an O(n) operation, so it is preferred over count_user_posts() any time more than a single count is needed.
<?php count_many_users_posts( $users, $post_type, $public_only ); ?>
The call to count_many_users_posts returns the number of posts made by each user.
<?php $users = array(1, 3, 9, 10); $counts = count_many_users_posts($users); echo 'Posts made by user 3: ' . $counts[3]; ?>
count_many_users_posts() is located in wp-includes/user.php.
count_user_posts, get_posts_by_author_sql