[wp-trac] [WordPress Trac] #45976: Move logic to find next event from `wp_next_scheduled()` to `wp_get_scheduled_event()`.

WordPress Trac noreply at wordpress.org
Mon Jan 14 02:44:36 UTC 2019


#45976: Move logic to find next event from `wp_next_scheduled()` to
`wp_get_scheduled_event()`.
---------------------------+-----------------------------
 Reporter:  peterwilsoncc  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Cron API       |    Version:  trunk
 Severity:  normal         |   Keywords:  has-patch
  Focuses:                 |
---------------------------+-----------------------------
 The new function for 5.1 `wp_get_scheduled_event()` accepts the timestamp
 as an optional argument. If no timestamp is specified the next scheduled
 event is returned.

 If no timestamp is specified, it current makes use of
 `wp_next_scheduled()` to determine the timestamp of the next event. This
 results in running code to get the cron array and determine the key twice.

 The logic could be reversed, `wp_get_scheduled_event()` could determine
 the next event and `wp_next_scheduled()` make use of that function if an
 event is returned.

 This will allow the `pre_next_scheduled` and `next_scheduled` filters to
 be deprecated. If the change is made prior to WP 5.1's release, they can
 be removed.

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


More information about the wp-trac mailing list