Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#18471 new enhancement

Add action hook after cron processed it's jobs

Reported by: tott Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.2.1
Component: Cron API Keywords: has-patch
Focuses: Cc:


Sometimes it's hard to debug cron jobs or validate the results. A simple action fired after the wp-cron.php did his magic could help improve this experience.

Attachments (2)

wp-cron-action-hook.diff (230 bytes) - added by tott 4 years ago.
Add action hook to wp-cron.php
22143.diff (455 bytes) - added by batmoo 3 years ago.

Download all attachments as: .zip

Change History (10)

4 years ago

Add action hook to wp-cron.php

#1 @danielbachhuber
4 years ago

  • Cc wordpress@… added

#2 @nacin
3 years ago

#22143 was marked as a duplicate.

#3 @toscho
3 years ago

  • Cc info@… added

#4 @scribu
3 years ago

  • Keywords has-patch added

I guess using the 'shutdown' hook wouldn't do, since you would want access to the jobs just completed.

How about calling the hook 'did_cron' instead?

Last edited 3 years ago by scribu (previous) (diff)

3 years ago

#5 @batmoo
3 years ago

Added patch from #22143; it fires the action immediately after the event has executed and passes in some args specific to that event.

This ticket was mentioned in IRC in #wordpress-dev by danielbachhuber. View the logs.

22 months ago

#7 @mnelson4
9 months ago

I found myself wanting a hook like this too. The shutdown hook was a little too late for my application (and I wouldn't want my code to step on the feet of other shutdown code)

#8 @The Plugin Factory
5 months ago

I too would like this functionality. Anyone know what the next closest hook is in the flow of loading things?

Note: See TracTickets for help on using tickets.