mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
REST API: Prime caches for featured images in post controller.
Ensure that featured image caches are primed for post collections in the post REST API controller, by calling the `update_post_thumbnail_cache` function. Props Spacedmonkey, TimothyBlynJacobs, mitogh. Fixes #55592. git-svn-id: https://develop.svn.wordpress.org/trunk@53499 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -370,6 +370,9 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
$posts = array();
|
||||
|
||||
update_post_author_caches( $query_result );
|
||||
if ( post_type_supports( $this->post_type, 'thumbnail' ) ) {
|
||||
update_post_thumbnail_cache( $posts_query );
|
||||
}
|
||||
|
||||
foreach ( $query_result as $post ) {
|
||||
if ( ! $this->check_read_permission( $post ) ) {
|
||||
|
||||
Reference in New Issue
Block a user