mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
REST API: Prime post caches in comments endpoint.
Prevent each call to `get_post()` triggering a seperate database query by priming the cache of each comment's post in the REST API's comments endpoint. Props spacedmonkey, timothyblynjacobs. Fixes #56272. git-svn-id: https://develop.svn.wordpress.org/trunk@53772 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6cbed78c94
commit
c1cf07e4e3
@ -244,6 +244,8 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
|
||||
$prepared_args['no_found_rows'] = false;
|
||||
|
||||
$prepared_args['update_comment_post_cache'] = true;
|
||||
|
||||
$prepared_args['date_query'] = array();
|
||||
|
||||
// Set before into date query. Date query must be specified as an array of an array.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user