Skip to content

Instantly share code, notes, and snippets.

@ooooak
Created July 31, 2015 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ooooak/9c079c6e53606d6d50a5 to your computer and use it in GitHub Desktop.
Save ooooak/9c079c6e53606d6d50a5 to your computer and use it in GitHub Desktop.
[wordpress] remove all schedules
//Add cron
function ffs(){
echo "string";
}
add_action('init', function(){
error_reporting(-1);
$events = array(
'admin_theme_wysija_hourly',
);
var_dump(wp_get_schedule($events[0]));
var_dump(wp_clear_scheduled_hook('hourly', 'admin_theme_wysija_hourly'));
var_dump(wp_get_schedule($events[0]));
exit;
foreach ($events as $event) {
if (wp_get_schedule($event)){
var_dump(wp_clear_scheduled_hook($event));
exit;
}
}
exit;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment