Completed
Push — update/import-sync-detection ( cc9b3b...d0bcf1 )
by
unknown
35:42 queued 28:04
created

manage.php ➔ jetpack_manage_config_screen()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Module Name: Manage
4
 * Module Description: Manage all of your sites from a centralized dashboard.
5
 * Jumpstart Description: Helps you remotely manage plugins, turn on automated updates, and more from <a href="https://wordpress.com/plugins/" target="_blank">wordpress.com</a>.
6
 * Sort Order: 1
7
 * Recommendation Order: 3
8
 * First Introduced: 3.4
9
 * Requires Connection: Yes
10
 * Auto Activate: Yes
11
 * Module Tags: Centralized Management, Recommended
12
 * Feature: General
13
 * Additional Search Queries: manage, management, remote
14
 */
15
add_action( 'customize_register', 'add_wpcom_to_allowed_redirect_hosts' );
16
17
// Add wordpress.com to the safe redirect whitelist if the Manage module is enabled
18
// so the customizer can `return` to wordpress.com if invoked from there.
19
function add_wpcom_to_allowed_redirect_hosts( $domains ) {
20
	if ( Jetpack::is_module_active( 'manage' ) ) {
21
		add_filter( 'allowed_redirect_hosts', 'allow_wpcom_domain' );
22
	}
23
}
24
25
// Return $domains, with 'wordpress.com' appended.
26
function allow_wpcom_domain( $domains ) {
27
	if ( empty( $domains ) ) {
28
		$domains = array();
29
	}
30
	$domains[] = 'wordpress.com';
31
	return array_unique( $domains );
32
}
33
34
Jetpack::module_configuration_screen( 'manage', 'jetpack_manage_config_screen' );
35
function jetpack_manage_config_screen() {
36
	include ( JETPACK__PLUGIN_DIR . 'modules/manage/confirm-admin.php' );
37
}
38