[wp-trac] [WordPress Trac] #57012: WP_Query caching discards `posts_fields` and `posts_clauses['fields']` filters.

WordPress Trac noreply at wordpress.org
Tue Nov 8 01:15:33 UTC 2022


#57012: WP_Query caching discards `posts_fields` and `posts_clauses['fields']`
filters.
--------------------------------------+---------------------
 Reporter:  peterwilsoncc             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  6.1.1
Component:  Query                     |     Version:  6.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by peterwilsoncc):

 In the [https://github.com/WordPress/wordpress-develop/pull/3574 linked
 pull request]:

 * Added some tests to ensure modified `SELECT`s return the same values on
 the first and subsequent requests
 * Bypass the main cache (ie, revert to 6.0 behavior) if the `SELECT` has
 been modified from an expected form

 I considered caching modified `SELECT`s but figured some additional care
 would need to be taken to account for `SELECT`ing many values that could
 blow up the size of the cached value.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57012#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list