term_id_filter
Filters the term ID after a new term is created.
Usage
add_filter( 'term_id_filter', 'wp_kama_term_id_filter', 10, 3 ); /** * Function for `term_id_filter` filter-hook. * * @param int $term_id Term ID. * @param int $tt_id Term taxonomy ID. * @param array $args Arguments passed to wp_insert_term(). * * @return int */ function wp_kama_term_id_filter( $term_id, $tt_id, $args ){ // filter... return $term_id; }
- $term_id(int)
- Term ID.
- $tt_id(int)
- Term taxonomy ID.
- $args(array)
- Arguments passed to wp_insert_term().
Changelog
Since 2.3.0 | Introduced. |
Since 6.1.0 | The $args parameter was added. |
Where the hook is called
term_id_filter
term_id_filter
wp-includes/taxonomy.php 2691
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id, $args );
wp-includes/taxonomy.php 3433
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );