From 84a2c7f98068385d0d048a6817fe2e418ef2e5c0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 18 Apr 2008 17:42:13 +0000 Subject: [PATCH] Only use the args defined in defaults to compute the cache key in get_terms. Props mdawaffe. git-svn-id: https://develop.svn.wordpress.org/trunk@7738 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 785e28ff4c..4b15da22f2 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -580,7 +580,9 @@ function &get_terms($taxonomies, $args = '') { return $empty_array; } - $key = md5( serialize( $args ) . serialize( $taxonomies ) ); + // $args can be whatever, only use the args defined in defaults to compute the key + $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) ); + if ( $cache = wp_cache_get( 'get_terms', 'terms' ) ) { if ( isset( $cache[ $key ] ) ) return apply_filters('get_terms', $cache[$key], $taxonomies, $args);