wphooks.info - get_terms_defaults

get_terms_defaults

The hook occurs in the following file:

wp-includes/class-wp-term-query.php:
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
		/**
		 * Filters the terms query default arguments.
		 *
		 * Use {@see 'get_terms_args'} to filter the passed arguments.
		 *
		 * @since 4.4.0
		 *
		 * @param array $defaults   An array of default get_terms() arguments.
		 * @param array $taxonomies An array of taxonomies.
		 */
		$this->query_var_defaults = apply_filters( 'get_terms_defaults', $this->query_var_defaults, $taxonomies );

		$query = wp_parse_args( $query, $this->query_var_defaults );

		$query['number'] = absint( $query['number'] );
		$query['offset'] = absint( $query['offset'] );

		// 'parent' overrides 'child_of'.
		if ( 0 < intval( $query['parent'] ) ) {
			$query['child_of'] = false;