wp_count_posts

This filter is documented in wp-includes/post.php.

Description

apply_filters( 'wp_count_posts', (number) $counts, (unknown) $type, (unknown) $perm ); 

Parameters (3)

0. $counts (number)
The counts.
1. $type (unknown)
The type.
2. $perm (unknown)
The perm.

Usage

To run the hook, copy the example below.
  1. $counts = apply_filters( 'wp_count_posts', $counts, $type, $perm ); 
  2.  
  3. if ( !empty( $counts ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_count_posts callback 
  2. function filter_wp_count_posts( $counts, $type, $perm ) { 
  3. // make filter magic happen here... 
  4. return $counts
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_count_posts', 'filter_wp_count_posts', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_count_posts', 'filter_wp_count_posts', 10, 3 ); 

Defined (2)

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

/wp-includes/post.php  
  1. return apply_filters( 'wp_count_posts', $counts, $type, $perm ); 
  1. return apply_filters( 'wp_count_posts', $counts, $type, $perm );