WP_Term_Query::query( string|array $query ): WP_Term[]|int[]|string[]|string

Sets up the query and retrieves the results.


Description

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


Top ↑

Parameters

$query string|array Required
Array or URL query string of parameters.

Top ↑

Return

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


Top ↑

Source

File: wp-includes/class-wp-term-query.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
4.6.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.