[wp-trac] [WordPress Trac] #28310: Accessing properties of null returned from get_post()

WordPress Trac noreply at wordpress.org
Thu May 22 14:09:33 UTC 2014


#28310: Accessing properties of null returned from get_post()
----------------------------------------+--------------------
 Reporter:  GaryJ                       |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.0
Component:  Posts, Post Types           |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+--------------------

Comment (by GaryJ):

 Replying to [comment:4 SergeyBiryukov]:
 > These functions all currently return false on failure (that's what
 `mysql2date()` returns if `$date` is empty).
 >
 > I think we should keep that and just avoid a PHP notice. See
 [attachment:28310.3.diff].

 I'd like to see the number of types returned from functions reduced to one
 (return an empty string instead of false), not increased to three, but
 that's likely a different ticket.

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


More information about the wp-trac mailing list