public function clear_scheduled_event($hook)
{
$timestamp = wp_next_scheduled($hook);
if ($timestamp) {
wp_unschedule_event($timestamp, $hook);
}
if (is_multisite()) {
// Always clear schedule events on primary blog
$this->switch_to_blog();
$timestamp = wp_next_scheduled($hook);
if ($timestamp) {
wp_unschedule_event($timestamp, $hook);
}
$this->restore_current_blog();
}
}