Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#45797 closed enhancement (fixed)

Add function for getting "ready" cron jobs with preflight filter for hijacking.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Cron API Keywords: has-patch has-dev-note
Focuses: Cc:


Add the function wp_get_ready_cron_jobs() to return jobs ready to be run (with a timestamp in the past) with a preflight filter to allow plugins to use a custom cron storage mechanism.

This is to round out the functionality of #32656 to allow custom cron storage while making use of Core's system for spawning jobs.

Attachments (2)

45797.diff (2.5 KB) - added by peterwilsoncc 6 years ago.
45797.2.diff (2.5 KB) - added by peterwilsoncc 6 years ago.

Download all attachments as: .zip

Change History (7)

6 years ago

#1 @pento
6 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.1

This is fine to commit to finish off #32656.

#2 @peterwilsoncc
6 years ago

  • Owner set to peterwilsoncc
  • Status changed from new to assigned

45797.2.diff adds @since tags to the docblocks following Pento's code review and commit approval.

#3 @peterwilsoncc
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44483:

Cron API: Add function and filter to return ready cron jobs.

Add the function wp_get_ready_cron_jobs() to return a modified version of the cron array limited to jobs ready to be run, ie with a timestamp of time() or earlier.

The new function includes the filter pre_get_ready_cron_jobs to allow for custom cron storage systems. This rounds out the functionality added in #32656.

Props Pento for code review.
Fixes #45797.

#4 @desrosj
5 years ago

  • Keywords needs-dev-note added; commit removed

#5 @desrosj
4 years ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.