Ticket #18067: post-thumbnail-template.php.diff
| File post-thumbnail-template.php.diff, 944 bytes (added by TheDeadMedic, 23 months ago) |
|---|
-
post-thumbnail-template.php
50 50 /** 51 51 * Update cache for thumbnails in the current loop 52 52 * 53 * @sicne 3.2 53 * @since 3.2 54 * 55 * @param object $wp_query An instance of WP_Query with posts queried (optional) 54 56 */ 55 function update_post_thumbnail_cache() { 56 global $wp_query; 57 function update_post_thumbnail_cache( $wp_query = null ) { 58 if ( ! is_object( $wp_query ) || ! is_a( $wp_query, 'WP_Query' ) ) 59 $wp_query =& $GLOBALS['wp_query']; 57 60 58 61 if ( $wp_query->thumbnails_cached ) 59 62 return; … … 64 67 $thumb_ids[] = $id; 65 68 } 66 69 70 // filter out null/zero values (we may not need to query *at all*) 71 $thumb_ids = array_filter( $thumb_ids ); 72 67 73 if ( ! empty ( $thumb_ids ) ) { 68 74 get_posts( array( 69 75 'update_post_term_cache' => false,
