Uses
Uses | Description |
---|---|
wp-includes/cache.php: wp_cache_add() | Adds data to the cache, if the cache key doesn’t already exist. |
Updates posts in cache.
(WP_Post[]) (Required) Array of post objects (passed by reference).
File: wp-includes/post.php
function update_post_cache( &$posts ) { if ( ! $posts ) { return; } foreach ( $posts as $post ) { wp_cache_add( $post->ID, $post, 'posts' ); } }
Version | Description |
---|---|
1.5.1 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_post_cache