Action hook 'deleted_term_relationships'

in WP Core File wp-includes/taxonomy.php at line 3062

View Source

deleted_term_relationships

Action Hook
Description
Fires immediately after an object-term relationship is deleted.

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Action
Line Number 3062

Hook Parameters

Type Name Description
int $object_id Object ID.
array $tt_ids An array of term taxonomy IDs.
string $taxonomy Taxonomy slug.

Usage Examples

Basic Usage
<?php
// Hook into deleted_term_relationships
add_action('deleted_term_relationships', 'my_custom_function', 10, 3);

function my_custom_function($object_id, $tt_ids, $taxonomy) {
    // Your custom code here
}

Source Code Context

wp-includes/taxonomy.php:3062 - How this hook is used in WordPress core
<?php
3057  		 *
3058  		 * @param int    $object_id Object ID.
3059  		 * @param array  $tt_ids    An array of term taxonomy IDs.
3060  		 * @param string $taxonomy  Taxonomy slug.
3061  		 */
3062  		do_action( 'deleted_term_relationships', $object_id, $tt_ids, $taxonomy );
3063  
3064  		wp_update_term_count( $tt_ids, $taxonomy );
3065  
3066  		return (bool) $deleted;
3067  	}

PHP Documentation

<?php
/**
		 * Fires immediately after an object-term relationship is deleted.
		 *
		 * @since 2.9.0
		 * @since 4.7.0 Added the `$taxonomy` parameter.
		 *
		 * @param int    $object_id Object ID.
		 * @param array  $tt_ids    An array of term taxonomy IDs.
		 * @param string $taxonomy  Taxonomy slug.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.