apply_filters( 'wp_count_posts', stdClass $counts, string $type, string $perm )
- Since
- 3.7.0
Filters the post counts by status for the current post type.
Compatibility
- WordPress
- since 3.7.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$countsstdClass- An object containing the current post_type's post counts by status.
$typestring- Post type.
$permstring- The permission to determine if the posts are 'readable' by the current user.
Where this hook fires · 2
wp-includes/post.php:3483wp_count_posts()wp-includes/post.php:3540wp_count_posts()
Source code
<?php * @param stdClass $counts An object containing the current post_type's post * counts by status. * @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 beChangelog
Introduced in 3.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.