term_id_filter

Filters the term ID after a new term is created.

Description

apply_filters( 'term_id_filter', (int) $term_id, (int) $tt_id ); 

Parameters (2)

0. $term_id (int)
The term id.
1. $tt_id (int)
Taxonomy term ID.

Usage

To run the hook, copy the example below.
  1. $term_id = apply_filters( 'term_id_filter', $term_id, $tt_id ); 
  2.  
  3. if ( !empty( $term_id ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the term_id_filter callback 
  2. function filter_term_id_filter( $term_id, $tt_id ) { 
  3. // make filter magic happen here... 
  4. return $term_id
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'term_id_filter', 'filter_term_id_filter', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'term_id_filter', 'filter_term_id_filter', 10, 2 ); 

Defined (2)

The filter is defined in the following location(s).

/wp-includes/taxonomy.php  
  1. $term_id = apply_filters( 'term_id_filter', $term_id, $tt_id ); 
  1. $term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );