Function: _update_term_count_on_transition_post_status

_update_term_count_on_transition_post_status( string $new_status, string $old_status, WP_Post $post )

Update the custom taxonomies' term counts when a post's status is changed.

Shortcut: utcotps

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

For example, default posts term counts (for custom taxonomies) don't include private / draft posts.


Name Type(s) Default Value Description
$new_status string

New post status.

$old_status string

Old post status.

$post WP_Post

Post object.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.