Opened 14 years ago
Closed 2 years ago
#18471 closed enhancement (duplicate)
Add action hook after cron processed it's jobs
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 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 (14)
#4
@
13 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
@
13 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.
12 years ago
#7
@
11 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
@
10 years ago
I too would like this functionality. Anyone know what the next closest hook is in the flow of loading things?
#9
@
10 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