WordPress.org

Make WordPress Core

Ticket #40490: 40490.2.diff

File 40490.2.diff, 808 bytes (added by dlh, 2 years ago)

Refining docs

  • src/wp-includes/media.php

     
    13351335
    13361336        if ( count( $attachment_ids ) > 1 ) {
    13371337                /*
    1338                  * Warm object cache for use with 'get_post_meta()'.
    1339                  *
    1340                  * To avoid making a database call for each image, a single query
    1341                  * warms the object cache with the meta information for all images.
    1342                  */
    1343                 update_meta_cache( 'post', array_keys( $attachment_ids ) );
     1338                 * Warm the object cache with post and meta information for all found
     1339                 * images to avoid making individual database calls.
     1340                 */
     1341                _prime_post_caches( array_keys( $attachment_ids ), false, true );
    13441342        }
    13451343
    13461344        foreach ( $selected_images as $image => $attachment_id ) {