WordPress at Your Fingertips
function is not described

WP_Term_Query::query() public WP 4.6.0

Sets up the query and retrieves the results.

The return type varies depending on the value passed to $args['fields']. See WP_Term_Query::get_terms() for details.

{} It's a method of the class: WP_Term_Query{}

No Hooks.


WP_Term[]|Int[]|String[]|String. Array of terms, or number of terms as numeric string when 'count' is passed as a query var.


$WP_Term_Query = new WP_Term_Query();
$WP_Term_Query->query( $query );
$query(string|array) (required)
Array or URL query string of parameters.


Since 4.6.0 Introduced.

Code of WP_Term_Query::query() WP 5.8.2

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