[wp-trac] [WordPress Trac] #52655: Ability to Change the wp_next_scheduled() function output.

WordPress Trac noreply at wordpress.org
Fri Feb 26 06:02:36 UTC 2021


#52655: Ability to Change the wp_next_scheduled() function output.
-------------------------+------------------------------
 Reporter:  infosatech   |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Cron API     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by infosatech):

 Hello @peterwilsoncc

 I have written a plugin to automatically migrate WP Cron to the Action
 Scheduler library. Here is the link: https://github.com/iamsayan/migrate-
 cron-to-action-scheduler/

 But Action Scheduler does not store recurrence value as WordPress stores
 using 'cron_schedules' filter. So, If I hijack wp_get_scheduled_event()
 function using filter 'pre_get_scheduled_event' then I can't set the
 recurrence. See here(https://github.com/iamsayan/migrate-cron-to-action-
 scheduler/blob/main/migrate-cron-to-action-scheduler.php#L299). I have to
 set it as false which is, I think, not recommended.

 So I think just to hijack the wp_next_scheduled() function and not the
 wp_get_scheduled_event() function.

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


More information about the wp-trac mailing list