From 75660d68a089d7380c2094c4bd450ce5376074bd Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 3 Jun 2011 15:24:14 +0000 Subject: [PATCH] Add cache_domain argument to get_terms() to allow caching to a unique set of cache buckets. Useful when taxonomy queries have been modified via filters and need their own cache space. Props mfields. fixes #13318 git-svn-id: http://svn.automattic.com/wordpress/trunk@18128 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index af056058a..2874891fe 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1129,6 +1129,11 @@ function get_term_to_edit( $id, $taxonomy ) { * The 'parent' argument is different from 'child_of' in that a term X is considered a 'parent' * of term Y only if term X is the father of term Y, not its grandfather or great-grandfather, etc. * + * The 'cache_domain' argument enables a unique cache key to be produced when this query is stored + * in object cache. For instance, if you are using one of this function's filters to modify the + * query (such as 'terms_clauses'), setting 'cache_domain' to a unique value will not overwrite + * the cache for similar queries. Default value is 'core'. + * * @package WordPress * @subpackage Taxonomy * @since 2.3.0 @@ -1161,7 +1166,7 @@ function &get_terms($taxonomies, $args = '') { 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', - 'pad_counts' => false, 'offset' => '', 'search' => ''); + 'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' ); $args = wp_parse_args( $args, $defaults ); $args['number'] = absint( $args['number'] ); $args['offset'] = absint( $args['offset'] );