From 3495bf80e099a547387ac6315c6b5c382b9281d8 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@7738 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 785e28ff4..4b15da22f 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);