update_post_cache() WP 1.5.1
Updates posts in cache.
Хуков нет.
Возвращает
null
. Ничего.
Использование
update_post_cache( $posts );
- $posts(WP_Post[]) (обязательный) (передается по ссылке — &)
- Array of post objects (passed by reference).
Список изменений
С версии 1.5.1 | Введена. |
Код update_post_cache() update post cache WP 5.7.1
function update_post_cache( &$posts ) {
if ( ! $posts ) {
return;
}
foreach ( $posts as $post ) {
wp_cache_add( $post->ID, $post, 'posts' );
}
}