get_usernumposts
Retrieves the number of posts a user has written.
Description
(int) get_usernumposts( (int) $userid );
Returns (int)
Number of posts the given user has written.
Parameters (1)
- 0. $userid (int)
- User to count posts for.
Usage
if ( !function_exists( 'get_usernumposts' ) ) { require_once ABSPATH . WPINC . '/deprecated.php'; } // User to count posts for. $userid = -1; // NOTICE! Understand what this does before running. $result = get_usernumposts($userid);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/deprecated.php
- function get_usernumposts( $userid ) {
- _deprecated_function( __FUNCTION__, '3.0.0', 'count_user_posts()' );
- return count_user_posts( $userid );
- }