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

WordPress Trac noreply at wordpress.org
Sat May 4 20:53:58 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 rodionov201):

 In WordPress version 6.2, it has been observed that using a classic theme
 with sticky posts can lead to duplicate queries in WP_Query. This issue
 seems to arise because the post_type variable passed to the sticky sub-
 query is an empty string in the initial run, causing different cache query
 keys to be generated. Given the complexity of the bug and the solutions
 being proposed, what would be the most efficient method to resolve this
 issue while ensuring backwards compatibility? Additionally, could
 implementing a default post type when none is specified, as suggested in
 recent discussions, effectively prevent such discrepancies in future
 versions?

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


More information about the wp-trac mailing list