[wp-trac] [WordPress Trac] #56991: Update to get_page_by_title in 6.1 changes WHERE clause

WordPress Trac noreply at wordpress.org
Sat Nov 5 07:22:34 UTC 2022


#56991: Update to get_page_by_title in 6.1 changes WHERE clause
--------------------------+---------------------
 Reporter:  Bjorn2404     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.1.1
Component:  General       |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by dilipbheda):

 When I changed the post status to "any," the mentioned problem seemed to
 be resolved.

 `'post_status' => 'any',`

 SQL Query:


 {{{
 SELECT
   wp_posts.ID
 FROM
   wp_posts
 WHERE
   1 = 1
   AND wp_posts.post_title = 'Test'
   AND wp_posts.post_type = 'page'
   AND (
     (
       wp_posts.post_status <> 'trash'
       AND wp_posts.post_status <> 'auto-draft'
     )
   )
 ORDER BY
   wp_posts.post_date ASC,
   wp_posts.ID ASC
 LIMIT
   0, 1
 }}}

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


More information about the wp-trac mailing list