apply_filters( 'pre_count_many_users_posts', string[]|null $count, int[] $users, string|string[] $post_type, bool $public_only )
- Since
- 6.8.0
Filters whether to short-circuit performing the post counts.
Description
When filtering, return an array of posts counts as strings, keyed by the user ID.
Compatibility
- WordPress
- since 6.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 4 of the 5 tracked releases, added in 6.8.0.
Parameters
$countstring[]|null- The post counts. Return a non-null value to short-circuit.
$usersint[]- Array of user IDs.
$post_typestring|string[]- Single post type or array of post types to check.
$public_onlybool- Whether to only return counts for public posts.
Where this hook fires · 1
wp-includes/user.php:681count_many_users_posts()
Source code
* * @param string[]|null $count The post counts. Return a non-null value to short-circuit. * @param int[] $users Array of user IDs. * @param string|string[] $post_type Single post type or array of post types to check. * @param bool $public_only Whether to only return counts for public posts. */ $pre = apply_filters( 'pre_count_many_users_posts', null, $users, $post_type, $public_only ); if ( null !== $pre ) { return $pre; } // Cleanup the users array. Remove duplicates and sort for consistent ordering. $users = array_unique( array_filter( array_map( 'intval', $users ) ) );Changelog
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.
Signature, return type and hooks compared across 4 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.