update_post_term_count_statuses хук-фильтрWP 5.7.0

Filters the post statuses for updating the term count.

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

add_filter( 'update_post_term_count_statuses', 'wp_kama_update_post_term_count_statuses_filter', 10, 2 );

/**
 * Function for `update_post_term_count_statuses` filter-hook.
 * 
 * @param string[]    $post_statuses List of post statuses to include in the count.
 * @param WP_Taxonomy $taxonomy      Current taxonomy object.
 *
 * @return string[]
 */
function wp_kama_update_post_term_count_statuses_filter( $post_statuses, $taxonomy ){

	// filter...
	return $post_statuses;
}
$post_statuses(string[])
List of post statuses to include in the count.
По умолчанию: 'publish'
$taxonomy(WP_Taxonomy)
Current taxonomy object.

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

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

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

_update_post_term_count()
update_post_term_count_statuses
wp-includes/taxonomy.php 4080
$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) );

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

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