[wp-trac] [WordPress Trac] #56399: get_page_by_title() Is Not Checking "publish" Post Status

WordPress Trac noreply at wordpress.org
Wed Aug 17 22:11:35 UTC 2022


#56399: get_page_by_title() Is Not Checking "publish" Post Status
--------------------------------------+------------------------------
 Reporter:  xmic                      |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Posts, Post Types         |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by joyously):

 The function already returns the Post object, so the status can be
 checked, if needed.
 This seems a bit edge-case since this function would not be encountered by
 the user, and a plugin author could just as easily use `get_post` with
 more parameters, like this function does.
 There are also other `get_page_by*` functions that behave the same as this
 one.

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


More information about the wp-trac mailing list