manage.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. // Add wordpress.com to the safe redirect whitelist if the Manage module is enabled
  17. // so the customizer can `return` to wordpress.com if invoked from there.
  18. function add_wpcom_to_allowed_redirect_hosts( $domains ) {
  19. if ( Jetpack::is_module_active( 'manage' ) ) {
  20. add_filter( 'allowed_redirect_hosts', 'allow_wpcom_domain' );
  21. }
  22. }
  23. // Return $domains, with 'wordpress.com' appended.
  24. function allow_wpcom_domain( $domains ) {
  25. if ( empty( $domains ) ) {
  26. $domains = array();
  27. }
  28. $domains[] = 'wordpress.com';
  29. return array_unique( $domains );
  30. }
  31. Jetpack::module_configuration_screen( 'manage', 'jetpack_manage_config_screen' );
  32. function jetpack_manage_config_screen() {
  33. include ( JETPACK__PLUGIN_DIR . 'modules/manage/confirm-admin.php' );
  34. }