W3cubDocs

/WordPress

WP_Term_Query::query( string|array $query )

Sets up the query for retrieving terms.

Description

Parameters

$query

(string|array) (Required) Array or URL query string of parameters.

Return

(array|int) List of terms, or number of terms when 'count' is passed as a query var.

Source

File: wp-includes/class-wp-term-query.php

public function query( $query ) {
		$this->query_vars = wp_parse_args( $query );
		return $this->get_terms();
	}

Changelog

Version Description
4.6.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_term_query/query