
什么是Caniuse及如何使用它提升网站
update_post_parent_caches ( $posts )
update_post_parent_caches: 这个函数更新一个文章的父级缓存。它需要一个参数:$post_id。$post_id是需要更新父缓存的文章的ID。
更新一个文章对象列表的父文章缓存。
function update_post_parent_caches( $posts ) { $parent_ids = wp_list_pluck( $posts, 'post_parent' ); $parent_ids = array_map( 'absint', $parent_ids ); $parent_ids = array_unique( array_filter( $parent_ids ) ); if ( ! empty( $parent_ids ) ) { _prime_post_caches( $parent_ids, false ); } }