WC_Query::is_query_var_valid_on_front_page()privateWC 1.0

Checks whether a query var is allowed on the front page or not.

Method of the class: WC_Query{}

No Hooks.

Return

true|false. TRUE when query var is allowed on the front page. FALSE otherwise.

Usage

// private - for code of main (parent) class only
$result = $this->is_query_var_valid_on_front_page( $query_var );
$query_var(string) (required)
Query var name.

WC_Query::is_query_var_valid_on_front_page() code WC 8.7.0

private function is_query_var_valid_on_front_page( $query_var ) {
	return in_array( $query_var, array( 'preview', 'page', 'paged', 'cpage', 'orderby' ), true )
		|| in_array( $query_var, array( 'min_price', 'max_price', 'rating_filter' ), true )
		|| 0 === strpos( $query_var, 'filter_' )
		|| 0 === strpos( $query_var, 'query_type_' );
}