get_terms_defaults filter-hookWP 4.4.0

Filters the terms query default arguments.

Use get_terms_args to filter the passed arguments.

Usage

add_filter( 'get_terms_defaults', 'wp_kama_get_terms_defaults_filter', 10, 2 );

/**
 * Function for `get_terms_defaults` filter-hook.
 * 
 * @param array    $defaults   An array of default get_terms() arguments.
 * @param string[] $taxonomies An array of taxonomy names.
 *
 * @return array
 */
function wp_kama_get_terms_defaults_filter( $defaults, $taxonomies ){

	// filter...
	return $defaults;
}
$defaults(array)
An array of default get_terms() arguments.
$taxonomies(string[])
An array of taxonomy names.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

WP_Term_Query::parse_query()
get_terms_defaults
wp-includes/class-wp-term-query.php 259
$this->query_var_defaults = apply_filters( 'get_terms_defaults', $this->query_var_defaults, $taxonomies );

Where the hook is used in WordPress

Usage not found.