pre_wp_list_authors_post_counts_query
Filters whether to short-circuit performing the query for author post counts.
Usage
add_filter( 'pre_wp_list_authors_post_counts_query', 'wp_kama_pre_wp_list_authors_post_counts_query_filter', 10, 2 );
/**
* Function for `pre_wp_list_authors_post_counts_query` filter-hook.
*
* @param int[]|false $post_counts Array of post counts, keyed by author ID.
* @param array $parsed_args The arguments passed to wp_list_authors() combined with the defaults.
*
* @return int[]|false
*/
function wp_kama_pre_wp_list_authors_post_counts_query_filter( $post_counts, $parsed_args ){
// filter...
return $post_counts;
}
- $post_counts(int[]|false)
- Array of post counts, keyed by author ID.
- $parsed_args(array)
- The arguments passed to wp_list_authors() combined with the defaults.
Changelog
| Since 6.1.0 | Introduced. |
Where the hook is called
pre_wp_list_authors_post_counts_query
wp-includes/author-template.php 488
$post_counts = apply_filters( 'pre_wp_list_authors_post_counts_query', false, $parsed_args );