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: - Introduced in WordPress: 3.0.0
- Deprecated in WordPress: —
Description
Gets the number of posts a user has written.