Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Scriblio plugin/class-facet-taxonomy.php - No matching_post_ids fix
Index: plugin/class-facet-taxonomy.php
===================================================================
--- plugin/class-facet-taxonomy.php (revision 566010)
+++ plugin/class-facet-taxonomy.php (working copy)
@@ -89,7 +89,7 @@
$cache_key = md5( serialize( $matching_post_ids ));
- if( ! $this->facets->_matching_tax_facets = wp_cache_get( $cache_key , 'scrib-facet-taxonomy' ))
+ if( ! empty( $matching_post_ids ) && ! $this->facets->_matching_tax_facets = wp_cache_get( $cache_key , 'scrib-facet-taxonomy' ))
{
global $wpdb;
@@ -115,10 +115,14 @@
'term_taxonomy_id' => $term->term_taxonomy_id,
);
}
-
- wp_cache_set( $cache_key, $this->facets->_matching_tax_facets , 'scrib-facet-taxonomy', $this->ttl );
}
+ else
+ {
+ $this->facets->_matching_tax_facets = array();
+ }
+ wp_cache_set( $cache_key, $this->facets->_matching_tax_facets , 'scrib-facet-taxonomy', $this->ttl );
+
return $this->facets->_matching_tax_facets[ $this->name ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.