Warning: This function has been deprecated. Use count_user_posts() instead.

get_usernumposts() WordPress Function

The get_usernumposts() function is used to retrieve the number of posts a user has written. This function can be used to check if a user is eligible for a certain privileges based on the number of posts they have written.

get_usernumposts( int $userid ) #

Retrieves the number of posts a user has written.


Description

Top ↑

See also


Top ↑

Parameters

$userid

(int)(Required)User to count posts for.


Top ↑

Return

(int) Number of posts the given user has written.


Top ↑

Source

File: wp-includes/deprecated.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Use count_user_posts()
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More