WC_Query::get_main_tax_query()public staticWC 1.0

Get the tax query which was used by the main query.

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

Хуков нет.

Возвращает

Массив.

Использование

$result = WC_Query::get_main_tax_query();

Код WC_Query::get_main_tax_query() WC 9.3.3

public static function get_main_tax_query() {
	$tax_query = isset( self::$product_query->tax_query, self::$product_query->tax_query->queries ) ? self::$product_query->tax_query->queries : array();

	return $tax_query;
}