update_post_parent_caches

The timeline below displays how wordpress function update_post_parent_caches has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Updates parent post caches for a list of post objects.
 *
 * @since 6.1.0
 *
 * @param WP_Post[] $posts Array of post objects.
 */
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);
    }
}