Filter hook 'term_id_filter'

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

View Source

term_id_filter

Filter Hook
Description
Fires after a term in a specific taxonomy has been updated, but before the term cache has been cleaned. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include: - `edit_category` - `edit_post_tag`

Hook Information

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

Hook Parameters

Type Name Description
int $term_id Term ID.
int $tt_id Term taxonomy ID.
array $args Arguments passed to wp_update_term().

Usage Examples

Basic Usage
<?php
// Hook into term_id_filter
add_filter('term_id_filter', 'my_custom_filter', 10, 3);

function my_custom_filter($term_id, $tt_id, $args) {
    // Your custom filtering logic here
    return $term_id;
}

Source Code Context

wp-includes/taxonomy.php:3445 - How this hook is used in WordPress core
<?php
3440  	 * @param array $args    Arguments passed to wp_update_term().
3441  	 */
3442  	do_action( "edit_{$taxonomy}", $term_id, $tt_id, $args );
3443  
3444  	/** This filter is documented in wp-includes/taxonomy.php */
3445  	$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
3446  
3447  	clean_term_cache( $term_id, $taxonomy );
3448  
3449  	/**
3450  	 * Fires after a term has been updated, and the term cache has been cleaned.

PHP Documentation

<?php
/**
	 * Fires after a term in a specific taxonomy has been updated, but before the term
	 * cache has been cleaned.
	 *
	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
	 *
	 * Possible hook names include:
	 *
	 *  - `edit_category`
	 *  - `edit_post_tag`
	 *
	 * @since 2.3.0
	 * @since 6.1.0 The `$args` parameter was added.
	 *
	 * @param int   $term_id Term ID.
	 * @param int   $tt_id   Term taxonomy ID.
	 * @param array $args    Arguments passed to wp_update_term().
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.