Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::parse_query_args()protectedWC 1.0

Parse query args.

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

Хуков нет.

Возвращает

Массив.

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

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

Код AbstractProductGrid::parse_query_args() WC 8.7.0

protected function parse_query_args() {
	// Store the original meta query.
	$this->meta_query = WC()->query->get_meta_query();

	$query_args = array(
		'post_type'           => 'product',
		'post_status'         => 'publish',
		'fields'              => 'ids',
		'ignore_sticky_posts' => true,
		'no_found_rows'       => false,
		'orderby'             => '',
		'order'               => '',
		'meta_query'          => $this->meta_query, // phpcs:ignore WordPress.DB.SlowDBQuery
		'tax_query'           => array(), // phpcs:ignore WordPress.DB.SlowDBQuery
		'posts_per_page'      => $this->get_products_limit(),
	);

	$this->set_block_query_args( $query_args );
	$this->set_ordering_query_args( $query_args );
	$this->set_categories_query_args( $query_args );
	$this->set_visibility_query_args( $query_args );
	$this->set_stock_status_query_args( $query_args );

	return $query_args;
}