WC_Query::filter_out_valid_front_page_query_vars
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.
Returns
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() WC Query::filter out valid front page query vars code WC 10.7.0
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
);
}