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
This commit is contained in:
Ryan Boren 2008-04-18 17:42:13 +00:00
parent 7f228f1cd6
commit 84a2c7f980
1 changed files with 3 additions and 1 deletions

View File

@ -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);