WP HOOKS
filtrod 5.1.0

wp_insert_term_duplicate_term_check

Args 5Plik wp-includes/taxonomy.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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.

Parametry

ParametrTypOpis
$duplicate_termobjectDuplicate term row from terms table, if found.
$termstringTerm being inserted.
$taxonomystringTaxonomy name.
$argsarrayArguments passed to wp_insert_term().
$tt_idintterm_taxonomy_id for the newly created term.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_insert_term_duplicate_term_check', 'twoja_funkcja', 10, 5 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
	// Twój kod
}

Popularne w tej kategorii