Jetpack::init PHP Метод

init() публичный статический Метод

Singleton
public static init ( )
    public static function init()
    {
        if (!self::$instance) {
            self::$instance = new Jetpack();
            self::$instance->plugin_upgrade();
        }
        return self::$instance;
    }

Usage Example

 function __construct()
 {
     parent::__construct();
     Jetpack::init();
     // In WP 4.2 WP_List_Table will be sanitizing which values are __set()
     global $wp_version;
     if (version_compare($wp_version, '4.2-z', '>=') && $this->compat_fields && is_array($this->compat_fields)) {
         array_push($this->compat_fields, 'all_items');
     }
     $this->items = $this->all_items = Jetpack_Admin::init()->get_modules();
     $this->items = $this->filter_displayed_table_items($this->items);
     /**
      * Filters the list of modules available to be displayed in the Jetpack Settings screen.
      *
      * @since 3.0.0
      *
      * @param array $this->items Array of Jetpack modules.
      */
     $this->items = apply_filters('jetpack_modules_list_table_items', $this->items);
     $this->_column_headers = array($this->get_columns(), array(), array(), 'name');
     $modal_info = isset($_GET['info']) ? $_GET['info'] : false;
     wp_register_script('models.jetpack-modules', plugins_url('_inc/jetpack-modules.models.js', JETPACK__PLUGIN_FILE), array('backbone', 'underscore'), JETPACK__VERSION);
     wp_register_script('views.jetpack-modules', plugins_url('_inc/jetpack-modules.views.js', JETPACK__PLUGIN_FILE), array('backbone', 'underscore', 'wp-util'), JETPACK__VERSION);
     wp_register_script('jetpack-modules-list-table', plugins_url('_inc/jetpack-modules.js', JETPACK__PLUGIN_FILE), array('views.jetpack-modules', 'models.jetpack-modules', 'jquery'), JETPACK__VERSION, true);
     wp_localize_script('jetpack-modules-list-table', 'jetpackModulesData', array('modules' => Jetpack::get_translated_modules($this->all_items), 'i18n' => array('search_placeholder' => __('Search Modules…', 'jetpack')), 'modalinfo' => $this->module_info_check($modal_info, $this->all_items), 'nonces' => array('bulk' => wp_create_nonce('bulk-jetpack_page_jetpack_modules')), 'coreIconAvailable' => Jetpack::jetpack_site_icon_available_in_core()));
     wp_enqueue_script('jetpack-modules-list-table');
     /**
      * Filters the js_templates callback value.
      *
      * @since 3.6.0
      *
      * @param array array( $this, 'js_templates' ) js_templates callback.
      */
     add_action('admin_footer', apply_filters('jetpack_modules_list_table_js_template_callback', array($this, 'js_templates')), 9);
 }
All Usage Examples Of Jetpack::init
Jetpack