[wp-trac] [WordPress Trac] #10886: WordPress should not unnecessarily query posts at page load

WordPress Trac noreply at wordpress.org
Wed Mar 2 15:11:03 UTC 2022

#10886: WordPress should not unnecessarily query posts at page load
 Reporter:  junsuijin                            |       Owner:
                                                 |  spacedmonkey
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.0
Component:  Bootstrap/Load                       |     Version:  2.8.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests early has-patch       |     Focuses:
  needs-dev-note                                 |  performance
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


 In [changeset:"52814" 52814]:
 #!CommitTicketReference repository="" revision="52814"
 Bootstrap/Load: Stop unnecessary queries when using the `do_parse_request`

 Developers of plugins and themes can use the `do_parse_request` filter to
 hot-wire requests and hook in early to render custom pages. However, even
 through these request may not need post queries and 404 lookups to be run,
 they run anyway. This can results in unnecessary SQL queries running on
 these requests. By adding a return value to the `parse_request` method of
 the `WP` class, these queries can now be skipped.

 Props junsuijin, ryan, westi, sivel, dd32, wonderboymusic, arnee, tyxla,
 DrewAPicture, lukecavanagh, SergeyBiryukov, davidbaumwald, Spacedmonkey,
 Fixes #10886.

Ticket URL: <https://core.trac.wordpress.org/ticket/10886#comment:39>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list