On this page
apply_filters( 'wp_insert_term_duplicate_term_check', object $duplicate_term, string $term, string $taxonomy, array $args, int $tt_id )
Filters the duplicate term check that takes place during term creation.
Description
Term parent + taxonomy + slug combinations are meant to be unique, and wp_insert_term() performs a last-minute confirmation of this uniqueness before allowing a new term to be created. Plugins with different uniqueness requirements may use this filter to bypass or modify the duplicate-term check.
Parameters
$duplicate_termobject-
Duplicate term row from terms table, if found.
$termstring-
Term being inserted.
$taxonomystring-
Taxonomy name.
$argsarray-
Arguments passed to wp_insert_term() .
More Arguments from wp_insert_term( ... $args )
Array or query string of arguments for inserting a term.
alias_ofstringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.descriptionstringThe term description. Default empty string.parentintThe id of the parent term. Default 0.slugstringThe term slug to use. Default empty string.
$tt_idint-
term_taxonomy_id for the newly created term.
Source
File: wp-includes/taxonomy.php. View all references
$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );
Related
Used By
| Used By | Description |
|---|---|
| wp_insert_term() wp-includes/taxonomy.php | Adds a new term to the database. |
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_insert_term_duplicate_term_check