From add9cce1201b5028198dde57e359beac6062ca5b Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 27 Oct 2016 16:33:10 -0400 Subject: [PATCH] Fixed a potential 404 for shops excluding cats The Gilmore shop was producing 404 errors on the main shop page under certain conditions. Traced this to an in_array() call where the second parameter was not an array at the time. Added a test to make sure the parameter was an array before that function call and that cleared the problem. --- woocommerce/content-product_cat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce/content-product_cat.php b/woocommerce/content-product_cat.php index eabe9c2..c8df45a 100644 --- a/woocommerce/content-product_cat.php +++ b/woocommerce/content-product_cat.php @@ -24,7 +24,7 @@ global $woocommerce_loop; //$excludeCats = array( // 'souvenir' //); -if ( is_shop() && in_array( $category->slug, $excludeCats ) ) { +if ( is_shop() && is_array($excludeCats) && in_array( $category->slug, $excludeCats ) ) { return; } -- 2.17.1