count_user_posts


count_user_posts ( $userid, $post_type = 'post', $public_only = false )

Parameters:
  • (int) userid User ID.
  • (array|string) post_type Optional. Single post type or array of post types to count the number of posts for. Default 'post'.
  • (bool) public_only Optional. Whether to only return counts for public posts. Default false.
Returns:
  • (string) Number of posts the user has written in this post type.
Defined at:
Change Log:
  • 4: .
  • 4: .

Description

Gets the number of posts a user has written.

Related Functions

count_many_users_posts, count_users, wp_count_posts, get_usernumposts, query_posts

Top Google Results

User discussions

wpseek mobile