Make WordPress Core


Ignore:
Timestamp:
06/14/2022 01:08:39 PM (4 years ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r53498 r53499  
    371371
    372372                update_post_author_caches( $query_result );
     373                if ( post_type_supports( $this->post_type, 'thumbnail' ) ) {
     374                        update_post_thumbnail_cache( $posts_query );
     375                }
    373376
    374377                foreach ( $query_result as $post ) {
Note: See TracChangeset for help on using the changeset viewer.