set_object_terms
Fires after an object's terms have been set.
Usage
add_action( 'set_object_terms', 'wp_kama_set_object_terms_action', 10, 6 ); /** * Function for `set_object_terms` action-hook. * * @param int $object_id Object ID. * @param array $terms An array of object term IDs or slugs. * @param array $tt_ids An array of term taxonomy IDs. * @param string $taxonomy Taxonomy slug. * @param bool $append Whether to append new terms to the old terms. * @param array $old_tt_ids Old array of term taxonomy IDs. * * @return void */ function wp_kama_set_object_terms_action( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids ){ // action... }
- $object_id(int)
- Object ID.
- $terms(array)
- An array of object term IDs or slugs.
- $tt_ids(array)
- An array of term taxonomy IDs.
- $taxonomy(string)
- Taxonomy slug.
- $append(true|false)
- Whether to append new terms to the old terms.
- $old_tt_ids(array)
- Old array of term taxonomy IDs.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
wp-includes/taxonomy.php 2926
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );