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
This commit is contained in:
Sergey Biryukov 2016-07-20 15:06:19 +00:00
parent 1bda0a6e2e
commit f5f8d1df2b
1 changed files with 4 additions and 0 deletions

View File

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