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
This commit is contained in:
ryan 2008-04-18 17:42:13 +00:00
parent 1fdbde921b
commit 3495bf80e0
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);