Changeset 42343 for trunk/src/wp-includes/post-thumbnail-template.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-thumbnail-template.php
r41267 r42343 73 73 */ 74 74 function update_post_thumbnail_cache( $wp_query = null ) { 75 if ( ! $wp_query ) 75 if ( ! $wp_query ) { 76 76 $wp_query = $GLOBALS['wp_query']; 77 78 if ( $wp_query->thumbnails_cached ) 77 } 78 79 if ( $wp_query->thumbnails_cached ) { 79 80 return; 81 } 80 82 81 83 $thumb_ids = array(); 82 84 foreach ( $wp_query->posts as $post ) { 83 if ( $id = get_post_thumbnail_id( $post->ID ) ) 85 if ( $id = get_post_thumbnail_id( $post->ID ) ) { 84 86 $thumb_ids[] = $id; 85 } 86 87 if ( ! empty ( $thumb_ids ) ) { 87 } 88 } 89 90 if ( ! empty( $thumb_ids ) ) { 88 91 _prime_post_caches( $thumb_ids, false, true ); 89 92 } … … 146 149 */ 147 150 do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size ); 148 if ( in_the_loop() ) 151 if ( in_the_loop() ) { 149 152 update_post_thumbnail_cache(); 153 } 150 154 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); 151 155
Note: See TracChangeset
for help on using the changeset viewer.