update_post_cache example


function update_page_cache( &$pages ) {
    _deprecated_function( __FUNCTION__, '3.4.0', 'update_post_cache()' );

    update_post_cache( $pages );
}

/** * Will clean the page in the cache. * * Clean (read: delete) page from cache that matches $id. Will also clean cache * associated with 'all_page_ids' and 'get_pages'. * * @since 2.0.0 * @deprecated 3.4.0 Use clean_post_cache * @see clean_post_cache() * * @param int $id Page ID to clean */
$children = get_posts( $parsed_args );

    if ( ! $children ) {
        return $kids;
    }

    if ( ! empty( $parsed_args['fields'] ) ) {
        return $children;
    }

    update_post_cache( $children );

    foreach ( $children as $key => $child ) {
        $kids[ $child->ID ] = $children[ $key ];
    }

    if ( OBJECT === $output ) {
        return $kids;
    } elseif ( ARRAY_A === $output ) {
        $weeuns = array();
        foreach ( (array) $kids as $kid ) {
            $weeuns[ $kid->ID ] = get_object_vars( $kids[ $kid->ID ] );
        }
Home | Imprint | This part of the site doesn't use cookies.