From f5f8d1df2bda7d75fdb88b1eb68260d3351912c2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Jul 2016 15:06:19 +0000 Subject: [PATCH] Comments: Introduce the `cache_domain` argument for `WP_Comment_Query` to allow caching to a unique set of cache buckets. See [18128] for `get_terms()` and [37572] for `WP_Term_Query`. Props Chouby, rachelbaker. Fixes #37419. git-svn-id: https://develop.svn.wordpress.org/trunk@38117 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-comment-query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/class-wp-comment-query.php b/src/wp-includes/class-wp-comment-query.php index 2e652762ca..d1fb20e7d8 100644 --- a/src/wp-includes/class-wp-comment-query.php +++ b/src/wp-includes/class-wp-comment-query.php @@ -151,6 +151,7 @@ class WP_Comment_Query { * @since 4.4.0 Order by `comment__in` was added. `$update_comment_meta_cache`, `$no_found_rows`, * `$hierarchical`, and `$update_comment_post_cache` were added. * @since 4.5.0 Introduced the `$author_url` argument. + * @since 4.6.0 Introduced the `$cache_domain` argument. * @access public * * @param string|array $query { @@ -250,6 +251,8 @@ class WP_Comment_Query { * The parameter is ignored (forced to `false`) when * `$fields` is 'ids' or 'counts'. Accepts 'threaded', * 'flat', or false. Default: false. + * @type string $cache_domain Unique cache key to be produced when this query is stored in + * an object cache. Default is 'core'. * @type bool $update_comment_meta_cache Whether to prime the metadata cache for found comments. * Default true. * @type bool $update_comment_post_cache Whether to prime the cache for comment posts. @@ -299,6 +302,7 @@ class WP_Comment_Query { 'meta_query' => '', 'date_query' => null, // See WP_Date_Query 'hierarchical' => false, + 'cache_domain' => 'core', 'update_comment_meta_cache' => true, 'update_comment_post_cache' => false, );