Merge pull request #3011 from dominic-p/default-query-type

Add filter for default layered nav query type
This commit is contained in:
Mike Jolley 2013-04-24 05:33:48 -07:00
commit 16f706e086
1 changed files with 4 additions and 5 deletions

View File

@ -1412,11 +1412,10 @@ function woocommerce_layered_nav_init( ) {
$_chosen_attributes[ $taxonomy ]['terms'] = explode( ',', $_GET[ $name ] );
if ( ! empty( $_GET[ $query_type_name ] ) && $_GET[ $query_type_name ] == 'or' )
$_chosen_attributes[ $taxonomy ]['query_type'] = 'or';
else
$_chosen_attributes[ $taxonomy ]['query_type'] = 'and';
if ( empty( $_GET[ $query_type_name ] ) || ! in_array( strtolower( $_GET[ $query_type_name ] ), array( 'and', 'or' ) ) )
$_chosen_attributes[ $taxonomy ]['query_type'] = apply_filters( 'woocommerce_layered_nav_default_type', 'and' );
else
$_chosen_attributes[ $taxonomy ]['query_type'] = $_GET[ $query_type_name ];
}
}
}