apply_filters( 'wp_update_term_parent', int $parent_term, int $term_id, string $taxonomy, array $parsed_args, array $args )
- Since
- 3.1.0
Filters the term parent.
Description
Hook to this filter to see if it will cause a hierarchy loop.
Compatibility
- WordPress
- since 3.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$parent_termint- ID of the parent term.
$term_idint- Term ID.
$taxonomystring- Taxonomy slug.
$parsed_argsarray- An array of potentially altered update arguments for the given term.
$argsarray- Arguments passed to wp_update_term().
Where this hook fires · 1
wp-includes/taxonomy.php:3300wp_update_term()
Source code
* @param int $parent_term ID of the parent term. * @param int $term_id Term ID. * @param string $taxonomy Taxonomy slug. * @param array $parsed_args An array of potentially altered update arguments for the given term. * @param array $args Arguments passed to wp_update_term(). */ $parent = (int) apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args ); // Check for duplicate slug. $duplicate = get_term_by( 'slug', $slug, $taxonomy ); if ( $duplicate && $duplicate->term_id !== $term_id ) { /* * If an empty slug was passed or the parent changed, reset the slug to something unique.Changelog
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.