created_<taxonomy>
Fires after a new term in a specific taxonomy is created, and after the term cache has been cleaned.
Description
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.
- // run the action
- do_action( 'created_{$taxonomy}', $term_id, $tt_id );
- The following example is for adding a hook callback.
- // define the created_<taxonomy> callback
- function action_created_taxonomy( $term_id, $tt_id ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "created_{$taxonomy}", 'action_created_taxonomy', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( "created_{$taxonomy}", 'action_created_taxonomy', 10, 2 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/taxonomy.php
- do_action( "created_{$taxonomy}", $term_id, $tt_id );