term_exists_default_query_args хук-фильтрWP 6.0.0

Filters default query arguments for checking if a term exists.

Использование

add_filter( 'term_exists_default_query_args', 'wp_kama_term_exists_default_query_args_filter', 10, 4 );

/**
 * Function for `term_exists_default_query_args` filter-hook.
 * 
 * @param array      $defaults    An array of arguments passed to get_terms().
 * @param int|string $term        The term to check. Accepts term ID, slug, or name.
 * @param string     $taxonomy    The taxonomy name to use. An empty string indicates the search is against all taxonomies.
 * @param int|null   $parent_term ID of parent term under which to confine the exists search. Null indicates the search is unconfined.
 *
 * @return array
 */
function wp_kama_term_exists_default_query_args_filter( $defaults, $term, $taxonomy, $parent_term ){

	// filter...
	return $defaults;
}
$defaults(массив)
An array of arguments passed to get_terms().
$term(int|строка)
The term to check. Accepts term ID, slug, or name.
$taxonomy(строка)
The taxonomy name to use. An empty string indicates the search is against all taxonomies.
$parent_term(int|null)
ID of parent term under which to confine the exists search. Null indicates the search is unconfined.

Список изменений

С версии 6.0.0 Введена.

Где вызывается хук

term_exists()
term_exists_default_query_args
wp-includes/taxonomy.php 1606
$defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent_term );

Где используется хук в WordPress

Использование не найдено.