From 2a0ba812a351f21dccdfa26f445f77597541e12c Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 14 Feb 2019 15:58:12 +0000 Subject: [PATCH 1/2] Check for decoded taxonomy name when unsetting --- includes/data-stores/class-wc-product-data-store-cpt.php | 3 +++ includes/widgets/class-wc-widget-layered-nav.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-product-data-store-cpt.php b/includes/data-stores/class-wc-product-data-store-cpt.php index 8ccd8b10f3f..f80de361903 100644 --- a/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/includes/data-stores/class-wc-product-data-store-cpt.php @@ -748,6 +748,9 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da if ( taxonomy_exists( $attribute_key ) ) { // Handle attributes that have been unset. wp_set_object_terms( $product->get_id(), array(), $attribute_key ); + } elseif ( taxonomy_exists( urldecode( $attribute_key ) ) ) { + // Handle attributes that have been unset. + wp_set_object_terms( $product->get_id(), array(), urldecode( $attribute_key ) ); } continue; diff --git a/includes/widgets/class-wc-widget-layered-nav.php b/includes/widgets/class-wc-widget-layered-nav.php index 6598aefee40..10622670271 100644 --- a/includes/widgets/class-wc-widget-layered-nav.php +++ b/includes/widgets/class-wc-widget-layered-nav.php @@ -417,7 +417,7 @@ class WC_Widget_Layered_Nav extends WC_Widget { $query_hash = md5( $query ); // Maybe store a transient of the count values. - $cache = apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true ); + $cache = false;//apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true ); if ( true === $cache ) { $cached_counts = (array) get_transient( 'wc_layered_nav_counts_' . sanitize_title( $taxonomy ) ); } else { From 46d5a4c596a150d1de237f4b4646915e389e61f2 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 14 Feb 2019 15:58:53 +0000 Subject: [PATCH 2/2] Revert debug code --- includes/widgets/class-wc-widget-layered-nav.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/widgets/class-wc-widget-layered-nav.php b/includes/widgets/class-wc-widget-layered-nav.php index 10622670271..6598aefee40 100644 --- a/includes/widgets/class-wc-widget-layered-nav.php +++ b/includes/widgets/class-wc-widget-layered-nav.php @@ -417,7 +417,7 @@ class WC_Widget_Layered_Nav extends WC_Widget { $query_hash = md5( $query ); // Maybe store a transient of the count values. - $cache = false;//apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true ); + $cache = apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true ); if ( true === $cache ) { $cached_counts = (array) get_transient( 'wc_layered_nav_counts_' . sanitize_title( $taxonomy ) ); } else {