Fix set cache loop when no attributes exist

Test strictly for false to prevent an endless set cache loop when
you are not using attribute taxonomies or don't have any set.
Prevents `wc_get_attribute_taxonomies` function from calling `wp_cache_set` 
on every page load.
This commit is contained in:
Mat Lipe 2020-05-14 12:37:29 -05:00 committed by GitHub
parent 2462877c56
commit bf42110179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ function wc_get_attribute_taxonomies() {
$cache_key = $prefix . 'attributes';
$cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' );
if ( $cache_value ) {
if ( false !== $cache_value ) {
return $cache_value;
}