diff --git a/core.php b/core.php index 7bc2a0b..e6a6c40 100644 --- a/core.php +++ b/core.php @@ -7,12 +7,15 @@ function request( $request ) { if ( !isset( $_GET['qmt'] ) ) return $request; + $operator = strtoupper( $_GET['qmt_operator'] ); + foreach ( $_GET['qmt'] as $taxonomy => $terms ) { + $request['tax_query'][] = array( 'taxonomy' => $taxonomy, 'terms' => $terms, 'field' => 'term_id', - 'operator' => 'IN' + 'operator' => $operator ); } @@ -226,11 +229,11 @@ function is_multitax( $taxonomies = array() ) { * * @return array( taxonomy => query ) */ -function qmt_get_query( $taxname = '' ) { +function qmt_get_query( $taxname = '', $glue = '+' ) { global $wp_query; $qmt_query = array(); - + if ( !is_null( $wp_query->tax_query ) ) { foreach ( $wp_query->tax_query->queries as &$tax_query ) { $terms = _qmt_get_term_slugs( $tax_query ); @@ -243,7 +246,7 @@ function qmt_get_query( $taxname = '' ) { } foreach ( $qmt_query as &$value ) - $value = implode( '+', $value ); + $value = implode( $glue, $value ); } if ( $taxname ) { diff --git a/templates/checkboxes.html b/templates/checkboxes.html index f544f4d..85c00ae 100644 --- a/templates/checkboxes.html +++ b/templates/checkboxes.html @@ -1,5 +1,6 @@
- {{#taxonomy}} + + {{#taxonomy}}

{{title}}