term_id_filter filter-hookWP 2.3.0

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

wp_insert_term()
term_id_filter
wp_update_term()
term_id_filter
wp-includes/taxonomy.php 2684
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id, $args );
wp-includes/taxonomy.php 3428
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );

Where the hook is used in WordPress

Usage not found.