wppaste
WordPress

apply_filters( 'update_post_term_count_statuses', string[] $post_statuses, WP_Taxonomy $taxonomy )

Since
5.7.0
Filters the post statuses for updating the term count.

Compatibility

WordPress
since 5.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$post_statusesstring[]
List of post statuses to include in the count. Default is 'publish'.
$taxonomyWP_Taxonomy
Current taxonomy object.

Where this hook fires · 2

  • wp-includes/post.php:8453_update_term_count_on_transition_post_status()
  • wp-includes/taxonomy.php:4224_update_post_term_count()

Source code

	 *	 * @since 5.7.0	 *	 * @param string[]    $post_statuses List of post statuses to include in the count. Default is 'publish'.	 * @param WP_Taxonomy $taxonomy      Current taxonomy object.	 */	$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) ); 	foreach ( (array) $terms as $tt_id ) {		$count = 0; 		// Attachments can be 'inherit' status, we need to base count off the parent's status if so.		if ( $check_attachments ) {

Changelog

Introduced in 5.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 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.