W3cubDocs

/WordPress

get_usernumposts( int $userid ): int

Retrieves the number of posts a user has written.

Description

See also

Parameters

$useridintrequired
User to count posts for.

Return

int Number of posts the given user has written.

Source

function get_usernumposts( $userid ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'count_user_posts()' );
	return count_user_posts( $userid );
}

Changelog

Version Description
3.0.0 Use count_user_posts()
0.71 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_usernumposts