saved_term
Action HookDescription
Fires after a term for a specific taxonomy has been updated, and the term cache has been cleaned. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include: - `edited_category` - `edited_post_tag`Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Action |
Line Number | 3486 |
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 saved_term
add_action('saved_term', 'my_custom_function', 10, 3);
function my_custom_function($term_id, $tt_id, $args) {
// Your custom code here
}
Source Code Context
wp-includes/taxonomy.php:3486
- How this hook is used in WordPress core
<?php
3481 * @param array $args Arguments passed to wp_update_term().
3482 */
3483 do_action( "edited_{$taxonomy}", $term_id, $tt_id, $args );
3484
3485 /** This action is documented in wp-includes/taxonomy.php */
3486 do_action( 'saved_term', $term_id, $tt_id, $taxonomy, true, $args );
3487
3488 /** This action is documented in wp-includes/taxonomy.php */
3489 do_action( "saved_{$taxonomy}", $term_id, $tt_id, true, $args );
3490
3491 return array(
PHP Documentation
<?php
/**
* Fires after a term for a specific taxonomy has been updated, and the term
* cache has been cleaned.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `edited_category`
* - `edited_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: Action
- Parameters: 3
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.