Skip to content

Commit 773c43d

Browse files
authored
Merge pull request #172 from nowori/nowori-patch-1
Fix standard taxonomy links when WooCommerce is activated. Thanks to @nowori.
2 parents 655f572 + 930a4f7 commit 773c43d

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

includes/MslsOptionsTax.php

+12-13
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,18 @@ public static function create( $id = 0 ) {
7272
* Get the queried taxonomy
7373
* @return string
7474
*/
75-
public function get_tax_query() {
76-
global $wp_query;
77-
78-
if ( function_exists('is_woocommerce' ) ) {
79-
if ( is_woocommerce() && isset( $wp_query->tax_query->queries[1]['taxonomy'] ) ) {
80-
return $wp_query->tax_query->queries[1]['taxonomy'];
81-
}
82-
} elseif ( isset( $wp_query->tax_query->queries[0]['taxonomy'] ) ) {
83-
return $wp_query->tax_query->queries[0]['taxonomy'];
84-
}
85-
86-
return parent::get_tax_query();
87-
}
75+
public function get_tax_query() {
76+
global $wp_query;
77+
78+
if ( class_exists( 'WooCommerce' ) && is_woocommerce() && isset( $wp_query->tax_query->queries[1]['taxonomy'] ) ) {
79+
return $wp_query->tax_query->queries[1]['taxonomy'];
80+
}
81+
elseif ( isset( $wp_query->tax_query->queries[0]['taxonomy'] ) ) {
82+
return $wp_query->tax_query->queries[0]['taxonomy'];
83+
}
84+
85+
return parent::get_tax_query();
86+
}
8887

8988
/**
9089
* Get postlink

0 commit comments

Comments
 (0)