[wp-trac] [WordPress Trac] #53294: Adding filter hook to current_time() function

WordPress Trac noreply at wordpress.org
Tue Jun 1 20:23:44 UTC 2021


#53294: Adding filter hook to current_time() function
-------------------------+----------------------------
 Reporter:  wpvar        |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Date/Time    |     Version:  trunk
 Severity:  normal       |  Resolution:  wontfix
 Keywords:  has-patch    |     Focuses:  accessibility
-------------------------+----------------------------

Comment (by apedog):

 I'm just re-opening this for further discussion.

 There's a thematically related ticket #28636 that at one point had a
 suggestion for a `wp_strtotime` API (which would be a wrapper for `new
 DateTime( $input, wp_timezone() )`).

 I think perhaps WordPress core should provide wrapper-function
 /abstraction-layer/wordpress-way for working with PHP DateTime and
 timestamps.

 Much in the same way `wp_remote_get/request` abstracts cURL etc and lets
 devs make requests without using the underpinning mechanisms and parsing.

 The API should be simple and reliable.
 But a `wp_give_me_timestamp_based_on_these_prameters( ...args )` or
 `wp_give_me_datetime_based_on_these_prameters( ...args )` or
 `wp_give_me_now_based_on_these_parameters()` could be useful.

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


More information about the wp-trac mailing list