[wp-trac] [WordPress Trac] #57039: WP 6.1 - get_page_by_title(null) returns a page

WordPress Trac noreply at wordpress.org
Tue Nov 8 19:21:45 UTC 2022


#57039: WP 6.1 - get_page_by_title(null) returns a page
-------------------------------+------------------------------
 Reporter:  stentibbing        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  6.1
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by pbiron):

 @spacedmonkey on further testing, a `_doing_it_wrong()` when null (or the
 empty string) is passed is **not** the right thing to do.

 Why?  Because if there is a page (a post of the passed post type) which
 the empty string as it's `post_title`, then `get_page_by_title( null )` in
 WP 6.0 would return it.  So, my quick fix would be just another backwards
 incompatibility :-(

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


More information about the wp-trac mailing list