Skip to content

Instantly share code, notes, and snippets.

@paulgibbs
Last active December 17, 2015 05:59
Show Gist options
  • Save paulgibbs/5561643 to your computer and use it in GitHub Desktop.
Save paulgibbs/5561643 to your computer and use it in GitHub Desktop.
woocommerce taxonomy fix
Index: woocommerce-core-functions.php
===================================================================
--- woocommerce-core-functions.php (revision 711539)
+++ woocommerce-core-functions.php (working copy)
@@ -1425,6 +1425,9 @@
function woocommerce_terms_clauses( $clauses, $taxonomies, $args ) {
global $wpdb, $woocommerce;
+ // If we're not filtering a query for the product_cat taxonomy, bail out
+ if ( ! in_array( 'product_cat', $taxonomies ) ) return $clauses;
+
// No sorting when menu_order is false
if ( isset($args['menu_order']) && $args['menu_order'] == false ) return $clauses;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment