A WordPress-centric search engine for devs and theme authors



update_post_cache ›

Since1.5.1
Deprecatedn/a
update_post_cache ( $posts )
Parameters:
  • (array) $posts Array of post objects (passed by reference).
    Required: Yes
Defined at:
Codex:

Updates posts in cache.



Source

function update_post_cache( &$posts ) {
	if ( ! $posts ) {
		return;
	}

	foreach ( $posts as $post ) {
		wp_cache_add( $post->ID, $post, 'posts' );
	}
}