WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/update post caches

Contents

Description

Call major cache updating functions for list of Post objects.

Usage

<?php update_post_caches$posts$post_type
                             
$update_term_cache$update_meta_cache ); ?>

Parameters

$posts
(array) (required) Array of Post objects. Passed by reference.
Default: None
$post_type
(string|array) (optional) The post type(s) of the posts in $posts. You don't need to worry about this parameter if $update_term_cache is false. Passing "any" will cause the function to automatically set this to all the post types represented in $posts. If falsey, $post_type will default to "any".
Default: 'post'
$update_term_cache
(boolean) (optional) Whether to update the term cache.
Default: true
$update_meta_cache
(boolean) (optional) Whether to update the meta cache.
Default: true

Return Values

This function does not return a value.

Notes

Change Log

1.5.0

Source File

update_post_caches() is located in wp-includes/post.php.

Related

Post Cache Functions: clean_post_cache(), update_post_cache(), update_post_caches(), update_postmeta_cache()