Filter hook 'wp_insert_term_duplicate_term_check'

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

Description

Filters the duplicate term check that takes place during term creation. 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.

Occurrences

Filename Line Number
wp-includes/taxonomy.php 2629

Parameters

Type Name Description
object $duplicate_term Duplicate term row from terms table, if found.
string $term Term being inserted.
string $taxonomy Taxonomy name.
array $args Arguments passed to wp_insert_term().
int $tt_id term_taxonomy_id for the newly created term.

PHP Doc

/**
	 * Filters the duplicate term check that takes place during term creation.
	 *
	 * 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.
	 *
	 * @since 5.1.0
	 *
	 * @param object $duplicate_term Duplicate term row from terms table, if found.
	 * @param string $term           Term being inserted.
	 * @param string $taxonomy       Taxonomy name.
	 * @param array  $args           Arguments passed to wp_insert_term().
	 * @param int    $tt_id          term_taxonomy_id for the newly created term.
	 */