Automattic\WooCommerce\Blocks\BlockTypes

ProductQuery::get_valid_query_vars()privateWC 1.0

Return or initialize $valid_query_vars.

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

Хуков нет.

Возвращает

Массив.

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

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

Код ProductQuery::get_valid_query_vars() WC 8.7.0

private function get_valid_query_vars() {
	if ( ! empty( $this->valid_query_vars ) ) {
		return $this->valid_query_vars;
	}

	$valid_query_vars       = array_keys( ( new WP_Query() )->fill_query_vars( array() ) );
	$this->valid_query_vars = array_merge(
		$valid_query_vars,
		// fill_query_vars doesn't include these vars so we need to add them manually.
		array(
			'date_query',
			'exact',
			'ignore_sticky_posts',
			'lazy_load_term_meta',
			'meta_compare_key',
			'meta_compare',
			'meta_query',
			'meta_type_key',
			'meta_type',
			'nopaging',
			'offset',
			'order',
			'orderby',
			'page',
			'post_type',
			'posts_per_page',
			'suppress_filters',
			'tax_query',
		)
	);

	return $this->valid_query_vars;
}