Jetpack_Sync_Actions::init PHP Méthode

init() static public méthode

5 * MINUTE_IN_SECONDS;
static public init ( )
    static function init()
    {
        // everything below this point should only happen if we're a valid sync site
        if (!self::sync_allowed()) {
            return;
        }
        if (self::sync_via_cron_allowed()) {
            self::init_sync_cron_jobs();
        } else {
            if (wp_next_scheduled('jetpack_sync_cron')) {
                wp_clear_scheduled_hook('jetpack_sync_cron');
                wp_clear_scheduled_hook('jetpack_sync_full_cron');
            }
        }
        // On jetpack authorization, schedule a full sync
        add_action('jetpack_client_authorized', array(__CLASS__, 'do_full_sync'), 10, 0);
        // When importing via cron, do not sync
        add_action('wp_cron_importer_hook', array(__CLASS__, 'set_is_importing_true'), 1);
        // Sync connected user role changes to .com
        require_once dirname(__FILE__) . '/class.jetpack-sync-users.php';
        // publicize filter to prevent publicizing blacklisted post types
        add_filter('publicize_should_publicize_published_post', array(__CLASS__, 'prevent_publicize_blacklisted_posts'), 10, 2);
        /**
         * Fires on every request before default loading sync listener code.
         * Return false to not load sync listener code that monitors common
         * WP actions to be serialized.
         *
         * By default this returns true for cron jobs, non-GET-requests, or requests where the
         * user is logged-in.
         *
         * @since 4.2.0
         *
         * @param bool should we load sync listener code for this request
         */
        if (apply_filters('jetpack_sync_listener_should_load', true)) {
            self::initialize_listener();
        }
        add_action('init', array(__CLASS__, 'add_sender_shutdown'), 90);
    }