created_<taxonomy>

Fires after a new term in a specific taxonomy is created, and after the term cache has been cleaned.

Description

do_action( 'created_<taxonomy>', (int) $term_id, (int) $tt_id ); 

The dynamic portion(s) of the hook name refer to the taxonomy slug.

Parameters (2)

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

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'created_{$taxonomy}', $term_id, $tt_id ); 
The following example is for adding a hook callback.
  1. // define the created_<taxonomy> callback 
  2. function action_created_taxonomy( $term_id, $tt_id ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "created_{$taxonomy}", 'action_created_taxonomy', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "created_{$taxonomy}", 'action_created_taxonomy', 10, 2 ); 

Defined (1)

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

/wp-includes/taxonomy.php  
  1. do_action( "created_$taxonomy", $term_id, $tt_id );