WordPress.org

Make WordPress Core

Changeset 18128


Ignore:
Timestamp:
06/03/2011 03:24:14 PM (9 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r17997 r18128  
    11301130 * of term Y only if term X is the father of term Y, not its grandfather or great-grandfather, etc.
    11311131 *
     1132 * The 'cache_domain' argument enables a unique cache key to be produced when this query is stored
     1133 * in object cache. For instance, if you are using one of this function's filters to modify the
     1134 * query (such as 'terms_clauses'), setting 'cache_domain' to a unique value will not overwrite
     1135 * the cache for similar queries. Default value is 'core'.
     1136 *
    11321137 * @package WordPress
    11331138 * @subpackage Taxonomy
     
    11621167        'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '',
    11631168        'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '',
    1164         'pad_counts' => false, 'offset' => '', 'search' => '');
     1169        'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' );
    11651170    $args = wp_parse_args( $args, $defaults );
    11661171    $args['number'] = absint( $args['number'] );
Note: See TracChangeset for help on using the changeset viewer.