Function: get_usernumposts

get_usernumposts( integer $userid )

Retrieves the number of posts a user has written.

Parameters

Name Type(s) Default Value Description
$userid integer

User to count posts for.

Returns

integer

Number of posts the given user has written.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.