WC_Query::filter_out_valid_front_page_query_vars()privateWC 1.0

Returns a copy of $query with all query vars that are allowed on the front page stripped. Used when the shop page is also the front page.

Method of the class: WC_Query{}

No Hooks.

Return

Array. The filtered query vars.

Usage

// private - for code of main (parent) class only
$result = $this->filter_out_valid_front_page_query_vars( $query );
$query(array) (required)
The unfiltered array.

WC_Query::filter_out_valid_front_page_query_vars() code WC 9.3.3

private function filter_out_valid_front_page_query_vars( $query ) {
	return array_filter(
		$query,
		function( $key ) {
			return ! $this->is_query_var_valid_on_front_page( $key );
		},
		ARRAY_FILTER_USE_KEY
	);
}