| 1 |
<?php |
| 2 |
/** |
| 3 |
* Module Name: Manage |
| 4 |
* Module Description: Manage all your sites from a centralized place, https://wordpress.com/sites. |
| 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: Recommended |
| 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 |
|