From: Laury GvR Date: Thu, 27 Oct 2016 20:36:33 +0000 (-0400) Subject: Fixed a potential 404 for shops excluding cats X-Git-Tag: v1.1.4^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=164c44860da90e4ecebf78d57e2627748de8d8fa;p=WP-Themes%2Fjollylama.git 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. --- diff --git a/woocommerce/content-product_cat.php b/woocommerce/content-product_cat.php index 09595c9..ab6f203 100644 --- a/woocommerce/content-product_cat.php +++ b/woocommerce/content-product_cat.php @@ -22,10 +22,10 @@ global $woocommerce_loop; & $excludeCats array below. */ $excludeCats = array( - '' + '' ); -if ( is_shop() && in_array( $category->slug, $excludeCats ) ) { - return; +if ( is_shop() && is_array($excludeCats) && in_array( $category->slug, $excludeCats ) ) { + return; }