update_post_caches [ WordPress Function ]
update_post_caches ( $posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true )
| Parameters: |
|
| Uses: | |
| Defined at: |
|
Benzer Fonksiyonlar: update_post_cache, update_postmeta_cache, update_user_caches, update_page_cache, update_term_cache
Call major cache updating functions for list of Post objects.
Source
<?php
function update_post_caches(&$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true) {
// No point in doing all this work if we didn't match any posts.
if ( !$posts )
return;
update_post_cache($posts);
$post_ids = array();
foreach ( $posts as $post )
$post_ids[] = $post->ID;
if ( empty($post_type) )
$post_type = 'post';
if ( $update_term_cache ) {
if ( is_array($post_type) ) {
$ptypes = $post_type;
} elseif ( 'any' == $post_type ) {
// Just use the post_types in the supplied posts.
foreach ( $posts as $post )
$ptypes[] = $post->post_type;
$ptypes = array_unique($ptypes);
} else {
$ptypes = array($post_type);
}
if ( ! empty($ptypes) )
update_object_term_cache($post_ids, $ptypes);
}
if ( $update_meta_cache )
update_postmeta_cache($post_ids);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Adventures With The Wordpress Loop: Sticky Articles ...
Feb 18, 2007 ... The update_post_caches($posts) is straight out of the codex, to ensure that plugins work happily with these multiple loops. Also, once the code ...
www.unintentionallyblank.co.uk - WordPress › Support » Tags — update_post_caches
(forgot?) Register · WordPress › Support » update_post_caches ... get_post() not fetching from post cache after update_post_caches(), 1, Pinoy.ca, 2 years ...
wordpress.org - Function Reference/update post caches « WordPress Codex
Function Reference/update post caches. Contents. 1 Description; 2 Since; 3 Uses ; 4 Params; 5 Source. Description. Call major cache updating functions for list ...
codex.wordpress.org - update_post_caches (WordPress Function) - WPSeek.com
WordPress lookup for update_post_caches, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com