Automattic\WooCommerce\Blocks\BlockTypes

ProductFilterAttribute::get_filter_query_param_keys()publicWC 1.0

Register the query param keys.

Method of the class: ProductFilterAttribute{}

No Hooks.

Return

Array. Active filters param keys.

Usage

$ProductFilterAttribute = new ProductFilterAttribute();
$ProductFilterAttribute->get_filter_query_param_keys( $filter_param_keys, $url_param_keys );
$filter_param_keys(array) (required)
The active filters data.
$url_param_keys(array) (required)
The query param parsed from the URL.

ProductFilterAttribute::get_filter_query_param_keys() code WC 9.0.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
	);
}