delete_term_relationships
Fires immediately before an object-term relationship is deleted.
Usage
add_action( 'delete_term_relationships', 'wp_kama_delete_term_relationships_action', 10, 3 );
/**
* Function for `delete_term_relationships` action-hook.
*
* @param int $object_id Object ID.
* @param array $tt_ids An array of term taxonomy IDs.
* @param string $taxonomy Taxonomy slug.
*
* @return void
*/
function wp_kama_delete_term_relationships_action( $object_id, $tt_ids, $taxonomy ){
// action...
}
- $object_id(int)
- Object ID.
- $tt_ids(array)
- An array of term taxonomy IDs.
- $taxonomy(string)
- Taxonomy slug.
Changelog
| Since 2.9.0 | Introduced. |
| Since 4.7.0 | Added the $taxonomy parameter. |
Where the hook is called
delete_term_relationships
wp-includes/taxonomy.php 3051
do_action( 'delete_term_relationships', $object_id, $tt_ids, $taxonomy );