• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack::configure() – Before everything else starts getting initalized, we need to initialize Jetpack using the Config object.

You appear to be a bot. Output may be restricted

Description

Before everything else starts getting initalized, we need to initialize Jetpack using the Config object.

Usage

Jetpack::configure();

Parameters

Returns

void

Source

File name: jetpack/class.jetpack.php


Lines:

1 to 74 of 74
  public function configure() {
    $config = new Config();

    foreach (
      array(
        'sync',
      )
      as $feature
    ) {
      $config->ensure( $feature );
    }

    $config->ensure(
      'connection',
      array(
        'slug' => 'jetpack',
        'name' => 'Jetpack',
      )
    );

    if ( is_admin() ) {
      $config->ensure( 'jitm' );
    }

    if ( ! $this->connection_manager ) {
      $this->connection_manager = new Connection_Manager( 'jetpack' );
    }

    /*
		 * Load things that should only be in Network Admin.
		 *
		 * For now blow away everything else until a more full
		 * understanding of what is needed at the network level is
		 * available
		 */
    if ( is_multisite() ) {
      $network = Jetpack_Network::init();
      $network->set_connection( $this->connection_manager );
    }

    if ( $this->connection_manager->is_active() ) {
      add_action( 'login_form_jetpack_json_api_authorization', array( $this, 'login_form_json_api_authorization' ) );

      Jetpack_Heartbeat::init();
      if ( self::is_module_active( 'stats' ) && self::is_module_active( 'search' ) ) {
        require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.jetpack-search-performance-logger.php';
        Jetpack_Search_Performance_Logger::init();
      }
    }

    // Initialize remote file upload request handlers.
    $this->add_remote_request_handlers();

    /*
		 * Enable enhanced handling of previewing sites in Calypso
		 */
    if ( self::is_active() ) {
      require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.jetpack-iframe-embed.php';
      add_action( 'init', array( 'Jetpack_Iframe_Embed', 'init' ), 9, 0 );
      require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.jetpack-keyring-service-helper.php';
      add_action( 'init', array( 'Jetpack_Keyring_Service_Helper', 'init' ), 9, 0 );
    }

    if ( ( new Tracking( $this->connection_manager ) )->should_enable_tracking( new Terms_Of_Service(), new Status() ) ) {
      add_action( 'init', array( new Plugin_Tracking(), 'init' )  < );
    } else {
      
/**
 * Initialize tracking right after the user agrees to the terms of service.
 */
      add_action( 'jetpack_agreed_to_terms_of_service', array( new Plugin_Tracking(), 'init' )  < );
    }
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 4 April 2020 | Last updated: 10 December 2020

Primary Sidebar

Information

Function name: Jetpack::configure
Class ref: Jetpack
Plugin ref: Jetpack
Version: 9.2
Sourcefile: class.jetpack.php
File ref: class.jetpack.php
Deprecated?: No
API Letters: C,J

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites