The posts array result in WP_Query
is mapped to get_post()
(here and here) with:
$this->posts = array_map( 'get_post', $this->posts );
and that seems to be adding posts to the object cache even though the cache_results
argument is set to false
in WP_Query
.
Within the get_post()
function (here) we have:
$_post = WP_Post::get_instance( $post );
for the case when $post
is neither a WP_Post
or an object instance.
The WP_Post::get_instance
method contains wp_cache_get()
and wp_cache_set()
calls.
So that could explain the behavior you see in your example.
Related Posts:
- Is it possible to completely stop WP_Query retrieving posts?
- Using get_posts vs. WP_Query
- How to clear the cache?
- Should I use Transients with W3 Total Cache APC Caching? [closed]
- Duplicate Queries
- wp_transients | wp_object_cache VS SESSIONS & Cookies?
- Transient caching for wp query
- How do I force WP_query to fetch fresh, non-cached results?
- How to optimize multiple WP_Query() calls on one page?
- Assign Json file to WP_Query
- Should wp_query automatic meta and term cache priming be used in an enviroment with an object caching
- How to cache wp_query with pagination using transients?
- Transient api Caches confused
- Using Transients
- Exec wp query in slow motion to avoid memory error?
- Save large WP_Query to transient === false
- Check the stored / cached WP_Query with transients on post change
- get_posts query caching?
- Pagination in WP query with transient API
- How to save the results of a query as a php file for an autocomplete search bar
- WP_Query orderby date not working
- Best way to detect if you are in a SINGLE POST page
- Better way to get tag stats?
- Sort posts by custom taxonomy name
- Best practice custom function, where to echo the variables?
- How to get user_id from wordpress database inside ajax function?
- How to combine meta_query and post__in in WP_Query
- query user display_name failed in a custom mysql query foreach
- Query with custom taxonomy not working
- Query posts by specific word on title
- Date and Category query with filter
- How to change main query based on post meta
- add active class based on permalink and url
- Loop Split two Columns
- Search by post id in a specific page then auto-redirect to searched post
- Pretty urls for custom pagination
- WP_Query with ‘rand’, but equal number of posts from the taxonomy terms given
- How to make a second query offset -2 from current post
- slow query – Search for Media Gallery
- WordPress has a list of reserved words, can I override them, to use one in a query string?
- meta_query: check if number exists
- How to order WP_Query to group results?
- Search Page Returns Nothing
- WP Query causing timeout
- get term id from term name
- Query where ANDing slug values not working
- Woo Commerce using WP_Query to get products that match price range, with an additional required product attribute
- change posts_orderby of the callback wp_query?
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Content not displaying on paginated page
- Different Loop for tag pages?
- show custom category posts from a custom post type
- how to load posts to a custom post template after using template_redirect or template_include
- 2 queries with counters
- Multiple Query_Posts
- WP_Query: attachment image in “full” size?
- Page template doesn’t display simple HTML if inserted into other page?
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- Get categories within specific term
- Fix wp_term_relationships slow query in get_posts
- Custom query for custom post type not getting correct post ID
- How to merge these two post queries?
- How to search posts by title with special characters in WP_Query?
- How can I query a radius of coordinates?
- custom excerpt is not being shown
- WP_Query: Query posts only if their access is restricted to logged user’s role
- Get specific value from variable to use in query
- WP_Query with meta_query won’t orderby
- Adding Category in WP_Query Not Working
- meta_query only check if both value are set
- post_type not working when tag__in is present?
- display all posts from category with and without terms in chronological order
- How to create page that lists tags by initial letter?
- Seach and categories not working when ignoring sticky posts in main loop
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- WordPress: Cron locking and Queue
- Correct Way To Run Multiple Queries Sharing Some Base Data
- how to query for meta_value have array
- How to make the default WordPress search return borader results
- WP_Query shows all posts on single post pages
- Display Count of posts
- Optimize WP_Query
- Show sticky post before other WP_Query
- List ALL posts within last week from current category on category page
- WP_Query on “property” in the options table
- Dynamically name array in WordPress loop – add/get values
- Creating Custom Query
- Help in query for list links
- WP_Query issues with argument posts_per_page
- Search (Custom Form, Custom Search Result)
- Hook to get the query result after listing posts
- Elementor custom query
- Display post format post in the sidebar
- Is there another way to retrieve a post_id from post_meta other than a SQL query?