term_exists_default_query_args filter-hookWP 6.0.0

Filters default query arguments for checking if a term exists.

Usage

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   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 ){

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

Changelog

Since 6.0.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.