update_post_term_count_statuses filter-hookWP 5.7.0

Filters the post statuses for updating the term count.

Usage

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.
Default: 'publish'
$taxonomy(WP_Taxonomy)
Current taxonomy object.

Changelog

Since 5.7.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.