WP_Term_Query::query()publicWP 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.

Метод класса: WP_Term_Query{}

Хуков нет.


WP_Term[]|int[]|Строку[]|Строку. 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(строка|массив) (обязательный)
Array or URL query string of parameters.

Список изменений

С версии 4.6.0 Введена.

Код WP_Term_Query::query() WP 6.3.1

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