wp_count_posts

wp_count_posts

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('wp_count_posts') is found 2 times:

  • /wp-includes/post.php line 3325
    			}
    		}
    
    		/** This filter is documented in wp-includes/post.php */
    		return apply_filters( 'wp_count_posts', $counts, $type, $perm );
    	}
    
    	$query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";
    
    	if ( 'readable' === $perm && is_user_logged_in() ) {
    		$post_type_object = get_post_type_object( $type );
    
  • /wp-includes/post.php line 3363
    	 * @param string   $type   Post type.
    	 * @param string   $perm   The permission to determine if the posts are 'readable'
    	 *                         by the current user.
    	 */
    	return apply_filters( 'wp_count_posts', $counts, $type, $perm );
    }
    
    /**
     * Counts number of attachments for the mime type(s).
     *
     * If you set the optional mime_type parameter, then an array will still be
    

See this hook used in plugins: