Automattic\WooCommerce\Blocks\BlockTypes

ProductFilterAttribute::get_filter_query_param_keys()publicWC 1.0

Register the query param keys.

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

Хуков нет.

Возвращает

Массив. Active filters param keys.

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

$ProductFilterAttribute = new ProductFilterAttribute();
$ProductFilterAttribute->get_filter_query_param_keys( $filter_param_keys, $url_param_keys );
$filter_param_keys(массив) (обязательный)
The active filters data.
$url_param_keys(массив) (обязательный)
The query param parsed from the URL.

Код ProductFilterAttribute::get_filter_query_param_keys() WC 9.5.1

public function get_filter_query_param_keys( $filter_param_keys, $url_param_keys ) {
	$attribute_param_keys = array_filter(
		$url_param_keys,
		function ( $param ) {
			return strpos( $param, 'filter_' ) === 0 || strpos( $param, 'query_type_' ) === 0;
		}
	);

	return array_merge(
		$filter_param_keys,
		$attribute_param_keys
	);
}