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

WordPress Trac noreply at wordpress.org
Thu May 22 10:05:16 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 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].

 Also noticed that some functions do mention `int` in the return value in
 case of a Unix timestamp, and some don't. Leaving a note here to create a
 separate ticket for that.

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


More information about the wp-trac mailing list