Automattic\WooCommerce\Blocks\BlockTypes

ProductQuery::get_query_vars_from_filter_blocks()privateWC 1.0

Set the query vars that are used by filter blocks.

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

Хуков нет.

Возвращает

Массив.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_query_vars_from_filter_blocks();

Код ProductQuery::get_query_vars_from_filter_blocks() WC 7.3.0

private function get_query_vars_from_filter_blocks() {
	$attributes_filter_query_args = array_reduce(
		array_values( $this->get_filter_by_attributes_query_vars() ),
		function( $acc, $array ) {
			return array_merge( array_values( $array ), $acc );
		},
		array()
	);

	return array(
		'price_filter_query_args'      => array( PriceFilter::MIN_PRICE_QUERY_VAR, PriceFilter::MAX_PRICE_QUERY_VAR ),
		'stock_filter_query_args'      => array( StockFilter::STOCK_STATUS_QUERY_VAR ),
		'attributes_filter_query_args' => $attributes_filter_query_args,
		'rating_filter_query_args'     => array( RatingFilter::RATING_QUERY_VAR ),
	);

}