update_term_count
Fires when a term count is calculated, before it is updated in the database.
Usage
add_action( 'update_term_count', 'wp_kama_update_term_count_action', 10, 3 );
/**
* Function for `update_term_count` action-hook.
*
* @param int $tt_id Term taxonomy ID.
* @param string $taxonomy_name Taxonomy slug.
* @param int $count Term count.
*
* @return void
*/
function wp_kama_update_term_count_action( $tt_id, $taxonomy_name, $count ){
// action...
}
- $tt_id(int)
- Term taxonomy ID.
- $taxonomy_name(string)
- Taxonomy slug.
- $count(int)
- Term count.
Changelog
| Since 6.9.0 | Introduced. |
Where the hook is called
wp-includes/taxonomy.php 4203
do_action( 'update_term_count', $tt_id, $taxonomy->name, $count );
wp-includes/taxonomy.php 4233
do_action( 'update_term_count', $term, $taxonomy->name, $count );