[wp-trac] [WordPress Trac] #52448: wp_scheduled_delete WP-Cron Job Cannot Be Unscheduled
WordPress Trac
noreply at wordpress.org
Fri Feb 5 15:20:49 UTC 2021
#52448: wp_scheduled_delete WP-Cron Job Cannot Be Unscheduled
----------------------------+------------------------------
Reporter: daleharrison | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 4.9
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
----------------------------+------------------------------
Comment (by daleharrison):
Thanks @peterwilsoncc for the recommendations.
I didn't have any luck with `pre_schedule_event`, but for my purposes,
hooking into `schedule_event` and returning `false` for the event hook
`wp_scheduled_delete`, alongside my existing `wp_unschedule_event` code
has solved the problem.
This approach both removes the existing scheduled event and prevents it
from being scheduled again.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52448#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list