count_many_users_posts()返回多个用户的文章总数

目录

描述

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.

count_many_users_posts() 描述

用法

 <?php count_many_users_posts$users$post_type$public_only ); ?> 

count_many_users_posts() 用法

参数

$users

(array) (必填) List of ID values of the users whose post counts should be retrieved.

默认值: None

$post_type

(string) (可选) Name of the post type

默认值: null

$public_only

(string) (可选) Bypasses checking capabilities of current user (False) or returns posts only if they can be viewed by current user (True).

默认值: False

count_many_users_posts() 参数

历史

  • 3.5.0: 添加 public_only parameter
  • 添加于 版本: 3.0.0

count_many_users_posts() 历史

源文件

count_many_users_posts() 函数的代码位于 wp-includes/user.php.

count_many_users_posts() 源文件

相关