WordPress.org

Forums

get_post() not fetching from post cache after update_post_caches() (1 post)

  1. Pinoy.ca
    Member
    Posted 5 years ago #

    WordPress wizards, would you have a look at this code:

    $my_query = new WP_Query(array('post__in' => array(1,2,3)));
    update_post_caches($my_query->posts);
    echo $get_permalink(1);
    echo $get_the_title(2);

    Do you know why WordPress is still making SQL queries on lines 3 and 4? Shouldn't they be already in the object cache?

Topic Closed

This topic has been closed to new replies.

About this Topic