[wp-trac] [WordPress Trac] #59442: Duplicate query in WP_Query

WordPress Trac noreply at wordpress.org
Sat May 4 21:31:23 UTC 2024


#59442: Duplicate query in WP_Query
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  pbearne
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.6
Component:  Query                                |     Version:  6.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback early         |     Focuses:
  changes-requested                              |  performance
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 Thanks for your feedback @rodionov201

 The fix in the PR [https://github.com/WordPress/wordpress-
 develop/pull/6393 #6393] is pretty simple. As cache key is generated for
 the arguments passed to WP_Query, it means a arguments with empty string
 for post type and post type set to post, will generate a different cache
 key. In this PR, it cases where post type was set to empty string, post
 types passed an as array and other cases would result in a duplicate query
 have considered and unit tests written for them.

 If possible @rodionov201  can you test this PR / once this PR is committed
 to ensure it fixes your issue.

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


More information about the wp-trac mailing list