WordPress开发者和主题制作者的搜索引擎



update_post_cache ›

Since1.5.1
已弃用n/a
update_post_cache ( $posts )
参数:
  • (array) $posts Array of post objects (passed by reference).
    Required: Yes
定义在:
文档:

Updates posts in cache.



源码

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

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