wp_count_posts WordPress Filter Hook

The wp_count_posts hook is a great way to keep track of your post count in WordPress. This hook can be used in conjunction with the wp_list_categories function to display a list of categories and their post counts.

apply_filters( 'wp_count_posts', stdClass $counts, string $type, string $perm ) #

Modify returned post counts by status for the current post type.


Parameters

$counts

(stdClass)An object containing the current post_type's post counts by status.

$type

(string)Post type.

$perm

(string)The permission to determine if the posts are 'readable' by the current user.


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.7.0Introduced.

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
Show More