split_shared_term
Fires after a previously shared taxonomy term is split into two separate terms.
Description
do_action( 'split_shared_term', (int) $term_id, (int) $new_term_id, (int) $term_taxonomy_id, (string) $term_taxonomy_taxonomy );
Parameters (4)
- 0. $term_id (int)
- ID of the formerly shared term.
- 1. $new_term_id (int)
- ID of the new term created for the
$term_taxonomy_id
. - 2. $term_taxonomy_id (int)
- ID for the term_taxonomy row affected by the split.
- 3. $term_taxonomy_taxonomy (string)
- Taxonomy for the split term.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'split_shared_term', $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy_taxonomy );
- The following example is for adding a hook callback.
- // define the split_shared_term callback
- function action_split_shared_term( $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy_taxonomy ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'split_shared_term', 'action_split_shared_term', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'split_shared_term', 'action_split_shared_term', 10, 4 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/taxonomy.php
- do_action( 'split_shared_term', $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy->taxonomy );