wppaste
WordPress

apply_filters( 'term_exists_default_query_args', array $defaults, int|string $term, string $taxonomy, int|null $parent_term )

Since
6.0.0
Filters default query arguments for checking if a term exists.

Compatibility

WordPress
since 6.0.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$defaultsarray
An array of arguments passed to get_terms().
$termint|string
The term to check. Accepts term ID, slug, or name.
$taxonomystring
The taxonomy name to use. An empty string indicates the search is against all taxonomies.
$parent_termint|null
ID of parent term under which to confine the exists search.
Null indicates the search is unconfined.

Where this hook fires · 1

  • wp-includes/taxonomy.php:1631term_exists()

Source code

	 * @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.	 */	$defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent_term ); 	if ( ! empty( $taxonomy ) && is_numeric( $parent_term ) ) {		$defaults['parent'] = (int) $parent_term;	} 	if ( is_int( $term ) ) {

Changelog

Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.