Opened 12 years ago
Last modified 4 years ago
#18471 new enhancement
Add action hook after cron processed it's jobs
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 3.2.1 |
Component: | Cron API | Keywords: | has-patch |
Focuses: | Cc: |
Description
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 (3)
Change History (13)
#4
@
11 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?
#5
@
11 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.
9 years ago
#7
@
8 years 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
@
8 years ago
I too would like this functionality. Anyone know what the next closest hook is in the flow of loading things?
#9
@
8 years ago
This patch is an update to @batmoo with documentation added so it can be pushed in a future release. I changed the last parameter from $v
to $v['args']
because we shouldn't need to return the results of wp_reschedule_event()
(which modifies $v
specifically for rescheduling).
I left out @since
from the comment as I wasn't sure when this would be added.
Also just referencing this is for Contributor Day at WordCamp US 2015! :)
Add action hook to wp-cron.php