pre_wp_list_authors_post_counts_query хук-фильтрWP 6.1.0

Filters whether to short-circuit performing the query for author post counts.

Использование

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(массив)
The arguments passed to wp_list_authors() combined with the defaults.

Список изменений

С версии 6.1.0 Введена.

Где вызывается хук

wp_list_authors()
pre_wp_list_authors_post_counts_query
wp-includes/author-template.php 483
$post_counts = apply_filters( 'pre_wp_list_authors_post_counts_query', false, $parsed_args );

Где используется хук в WordPress

Использование не найдено.