[wp-trac] [WordPress Trac] #35968: wp_reschedule_event timestamp overridden when set in the future

WordPress Trac noreply at wordpress.org
Sun Feb 28 01:59:02 UTC 2016


#35968: wp_reschedule_event timestamp overridden when set in the future
--------------------------+--------------------------------
 Reporter:  svovaf        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cron API      |     Version:  4.4.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  docs, performance
--------------------------+--------------------------------

Comment (by jrf):

 Hi @svovaf,

 Thanks for reporting this. I've just had a look at this and while I
 understand what you're saying, I believe this is not a bug.

 If you want to schedule a recurring event, you should use the
 `wp_schedule_event()` function and set the `$recurrence` parameter. The
 `$timestamp` you provide will be respected.

 `wp_reschedule_event()` is - more than anything - intended for internal
 use. It is used during the running of a cron job to automatically
 '''re'''schedule a recurring event. In other words, it's called at
 approximately the time as set in `$timestamp` when the event was scheduled
 and used to schedule the next time this event should run.
 With that usage in mind, there's nothing really wrong with the code,
 though I agree the function description could be enhanced a little to
 highlight the intended use of the function.

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


More information about the wp-trac mailing list