update_post_parent_caches()
Updates parent post caches for a list of post objects.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
update_post_parent_caches( $posts );
- $posts(WP_Post[]) (обязательный)
- Array of post objects.
Список изменений
| С версии 6.1.0 | Введена. |
Код update_post_parent_caches() update post parent caches WP 7.1.3
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 );
}
}