Jetpack_Sync_Actions::maybe_schedule_sync_cron PHP Méthode

maybe_schedule_sync_cron() static public méthode

static public maybe_schedule_sync_cron ( $schedule, $hook )
    static function maybe_schedule_sync_cron($schedule, $hook)
    {
        if (!$hook) {
            return;
        }
        $schedule = self::sanitize_filtered_sync_cron_schedule($schedule);
        if (!wp_next_scheduled($hook)) {
            // Schedule a job to send pending queue items once a minute
            wp_schedule_event(time(), $schedule, $hook);
        } else {
            if ($schedule != wp_get_schedule($hook)) {
                // If the schedule has changed, update the schedule
                wp_clear_scheduled_hook($hook);
                wp_schedule_event(time(), $schedule, $hook);
            }
        }
    }