Closed peterwilsoncc closed 4 years ago
Note: pre_next_scheduled
was removed during the WordPress beta period. The logic for getting the next schedule task should now be included as part of the pre_get_scheduled_event
filter.
The description of this ticket has been updated to reflect these changes.
Notes:
HM\Cavalcade\Plugin\Job
class changes:
query( $event )
Searches for a single registered job depending on the event attributes.
$timestamp
return the next event$hook
fail (WP Core should catch this beforehand anyway)$schedule
or $interval
search single eventsget_jobs_by_hook( $hook, $args = null )
$hook
fail$args === null
return all jobs on hook regardless of argumentsget_by_site()
false
HM\Cavalcade\Plugin\Connector
changes
schedule_event()
and schedule_recurring_event()
pre_schedule_event( $pre, $event )
Job::get_job_by_attributes()
schedule_event()
if required$timestamp
but new $schedule
/$interval
replace existing taskpre_reschedule_event()
Job::get_job_by_attributes()
$timestamp
(nextrun + interval, per cavalcade design)schedule_event()
pre_unschedule_event()
Job::get_job_by_attributes()
Job::delete()
pre_clear_scheduled_hook()
pre_unschedule_hook
filterJob::get_jobs_by_hook()
pre_get_scheduled_event()
Job::get_job_by_attributes()
pre_get_ready_cron_jobs()
Job::get_by_site()
limited to ready jobs only.
Task When setting and getting Cron jobs, make use of the new WP filters:
pre_schedule_event
,pre_reschedule_event
,pre_unschedule_event
,pre_clear_scheduled_hook
,pre_unschedule_hook
,pre_get_scheduled_event
andpre_get_ready_cron_jobs
.Background In WordPress 5.1, new filters will be added to preflight event scheduling to allow for custom Cron storage systems.
The filters were added in WordPress#32656 (see WordPress/wordpress-develop@a32ea2d35d2fcf7bccf54ff7abfad9a2b49ee360) and WordPress#45797 (see WordPress/wordpress-develop@0bc20594c78369a6778635cd58f2b90c57428d6d).