[wp-trac] [WordPress Trac] #46210: Add helpers for default/empty datetime value

WordPress Trac noreply at wordpress.org
Thu Feb 7 22:37:30 UTC 2019


#46210: Add helpers for default/empty datetime value
-----------------------------+-----------------------------
 Reporter:  johnjamesjacoby  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Date/Time        |    Version:
 Severity:  normal           |   Keywords:  2nd-opinion
  Focuses:                   |
-----------------------------+-----------------------------
 Typing `0000-00-00 00:00:00` is error prone, and tedious.

 There are a few dozen usages of it sprinkled through-out WordPress.
 Hundreds of plugins also.

 I offer up the idea of 2 helper functions:
 * `__return_empty_datetime()` that simply returns `0000-00-00 00:00:00`
 * `is_empty_datetime( $datetime = '' )` to check if a variable is
 `empty()` or `0000-00-00 00:00:00`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46210>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list