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

  1. if ( !function_exists( 'get_usernumposts' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // User to count posts for. 
  5. $userid = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_usernumposts($userid); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_usernumposts( $userid ) { 
  2. _deprecated_function( __FUNCTION__, '3.0.0', 'count_user_posts()' ); 
  3. return count_user_posts( $userid );