Created
March 28, 2014 16:33
-
-
Save aradnom/9837085 to your computer and use it in GitHub Desktop.
Clear all crons in WordPress. This is a nuclear option, so use with care.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pull all crons from options | |
$crons = get_option('cron'); | |
// Kill each one. Filter by timestamp or hook_name if desired. | |
foreach ($crons as $timestamp => $hook) { | |
foreach ($hook as $hook_name => $details) { | |
wp_unschedule_event( $timestamp, $hook_name ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment