update_post_thumbnail_cache [ WordPress Function ]
update_post_thumbnail_cache ( $wp_query = null )
| Parameters: |
|
| Defined at: |
Benzer Fonksiyonlar: update_postmeta_cache, update_post_cache, the_post_thumbnail, update_post_caches, delete_post_thumbnail
Update cache for thumbnails in the current loop
Source
<?php
function update_post_thumbnail_cache( $wp_query = null ) {
if ( ! $wp_query )
$wp_query = $GLOBALS['wp_query'];
if ( $wp_query->thumbnails_cached )
return;
$thumb_ids = array();
foreach ( $wp_query->posts as $post ) {
if ( $id = get_post_thumbnail_id( $post->ID ) )
$thumb_ids[] = $id;
}
if ( ! empty ( $thumb_ids ) ) {
_prime_post_caches( $thumb_ids, false, true );
}
$wp_query->thumbnails_cached = true;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- #18067 (update_post_thumbnail_cache - accept WP_Query ...
update_post_thumbnail_cache - accept WP_Query instance ... be dead handy to be able to just call update_post_thumbnail_cache( $my_query ) - see revision.
core.trac.wordpress.org - #19949 (Make update_post_thumbnail_cache() work for any ...
It would be useful if update_post_thumbnail_cache() [17883] would accept an optional $wp_query parameter, so that users aren't forced to use query_posts() in ...
core.trac.wordpress.org - update_post_thumbnail_cache() WordPress function reference ...
function update_post_thumbnail_cache() { global $wp_query; if ( $wp_query-> thumbnails_cached ) return; $thumb_ids = array(); foreach ( $wp_query->posts as ...
queryposts.com - update_post_thumbnail_cache (WordPress Function) - WPSeek.com
WordPress lookup for update_post_thumbnail_cache, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com