Action hook 'edit_term'

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

View Source

edit_term

Action Hook
Description
Fires after a term has been updated, but before the term cache has been cleaned. The {@see 'edit_$taxonomy'} hook is also available for targeting a specific taxonomy.

Hook Information

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

Hook Parameters

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

Usage Examples

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

function my_custom_function($term_id, $tt_id, $taxonomy, $args) {
    // Your custom code here
}

Source Code Context

wp-includes/taxonomy.php:3422 - How this hook is used in WordPress core
<?php
3417  	 * @param int    $term_id  Term ID.
3418  	 * @param int    $tt_id    Term taxonomy ID.
3419  	 * @param string $taxonomy Taxonomy slug.
3420  	 * @param array  $args     Arguments passed to wp_update_term().
3421  	 */
3422  	do_action( 'edit_term', $term_id, $tt_id, $taxonomy, $args );
3423  
3424  	/**
3425  	 * Fires after a term in a specific taxonomy has been updated, but before the term
3426  	 * cache has been cleaned.
3427  	 *

PHP Documentation

<?php
/**
	 * Fires after a term has been updated, but before the term cache has been cleaned.
	 *
	 * The {@see 'edit_$taxonomy'} hook is also available for targeting a specific
	 * taxonomy.
	 *
	 * @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 string $taxonomy Taxonomy slug.
	 * @param array  $args     Arguments passed to wp_update_term().
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 4
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.