[wp-trac] [WordPress Trac] #34012: post_exists() results in a bad query

WordPress Trac noreply at wordpress.org
Wed May 26 02:16:19 UTC 2021


#34012: post_exists() results in a bad query
-------------------------------------------------+-------------------------
 Reporter:  apokalyptik                          |       Owner:  whyisjake
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.8
Component:  Posts, Post Types                    |     Version:  4.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

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


Comment:

 In [changeset:"51027" 51027]:
 {{{
 #!CommitTicketReference repository="" revision="51027"
 Posts, Post Types: Improve `post_exists()` query.

 Add `$status` parameter to `post_exists()` to allow developers to specify
 a post type, date and status to ensure they hit the `wp_posts` table's
 `type_status_date` index when determining if a post exists.

 Props apokalyptik, boonebgorges, brettshumaker, DrewAPicture,
 MikeHansenMe, peterwilsoncc, whyisjake.
 Fixes #34012.
 }}}

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


More information about the wp-trac mailing list