Properties

$instance

$instance : \Jetpack_Network

Holds a static copy of Jetpack_Network for the singleton

Type

\Jetpack_Network

$settings_name

$settings_name : string

Name of the network wide settings

Type

string

$setting_defaults

$setting_defaults : array

Defaults for settings found on the Jetpack > Settings page

Type

array

Methods

set_auto_activated_modules()

set_auto_activated_modules(array $modules) : array

Sets which modules get activated by default on subsite connection.

Modules can be set in Network Admin > Jetpack > Settings

Parameters

array $modules

Returns

array

render_jetpack_sites_column()

render_jetpack_sites_column(string $column_name, int $blog_id)

Displays the Jetpack connection status on the Network Admin > Sites page.

Parameters

string $column_name
int $blog_id

add_jetpack_sites_column()

add_jetpack_sites_column(array $columns) : array

Add the column for Jetpack connection status to the Network Admin > Sites list

Parameters

array $columns

Returns

array

do_automatically_add_new_site()

do_automatically_add_new_site(int $blog_id)

Registers new sites upon creation

Parameters

int $blog_id

body_class()

body_class( $classes)

Adds .network-admin class to the body tag Helps distiguish network admin JP styles from regular site JP styles

Parameters

$classes

init()

init() : \Jetpack_Network

Provides access to an instance of Jetpack_Network

This is how the Jetpack_Network object should always be accessed

Returns

\Jetpack_Network

register_menubar()

register_menubar()

Registers the Multisite admin bar menu item shortcut.

This shortcut helps users quickly and easily navigate to the Jetpack Network Admin menu from anywhere in their network.

deactivate()

deactivate()

Runs when Jetpack is deactivated from the network admin plugins menu.

Each individual site will need to have Jetpack::disconnect called on it. Site that had Jetpack individually enabled will not be disconnected as on Multisite individually activated plugins are still activated when a plugin is deactivated network wide.

add_to_menubar()

add_to_menubar()

Adds a link to the Jetpack Network Admin page in the netowrk admin menu bar.

get_url()

get_url(Mixed $args) : String

Returns various URL strings. Factory like

$args can be a string or an array. If $args is an array there must be an element called name for the switch statement

Currently supports:

  • subsiteregister: Pass array( 'name' => 'subsiteregister', 'site_id' => SITE_ID )
  • network_admin_page: Provides link to /wp-admin/network/JETPACK
  • subsitedisconnect: Pass array( 'name' => 'subsitedisconnect', 'site_id' => SITE_ID )

Parameters

Mixed $args

Returns

String

add_network_admin_menu()

add_network_admin_menu()

Adds the Jetpack menu item to the Network Admin area

admin_menu_css()

admin_menu_css()

Adds JP menu icon

jetpack_sites_list()

jetpack_sites_list()

Provides functionality for the Jetpack > Sites page.

Does not do the display!

show_jetpack_notice()

show_jetpack_notice()

do_subsitedisconnect()

do_subsitedisconnect( $site_id)

Disconnect functionality for an individual site

Parameters

$site_id

do_subsiteregister()

do_subsiteregister( $site_id)

Registers a subsite with the Jetpack servers

Parameters

$site_id

network_admin_styles()

network_admin_styles()

Add css styles needed for the Network Admin area

network_admin_page()

network_admin_page()

Handles the displaying of all sites on the network that are dis/connected to Jetpack

network_admin_page_header()

network_admin_page_header()

Stylized JP header formatting

network_admin_page_footer()

network_admin_page_footer()

Stylized JP footer formatting

save_network_settings_page()

save_network_settings_page()

Fires when the Jetpack > Settings page is saved.

render_network_admin_settings_page()

render_network_admin_settings_page()

update_option()

update_option(string $key, mixed $value) : boolean

Updates a site wide option

Parameters

string $key
mixed $value

Returns

boolean

get_option()

get_option(string $name)

Retrieves a site wide option

Parameters

string $name
  • Name of the option in the database

wp_get_sites()

wp_get_sites(array|string $args) : array

Return an array of sites on the specified network. If no network is specified, return all sites, regardless of network.

Parameters

array|string $args

Optional. Specify the status of the sites to return.

Returns

array —

An array of site data

__construct()

__construct()

Constructor