File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010require_once ( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php ' );
1111require_once ( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php ' );
1212require_once ( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php ' );
13+ require_once ( JETPACK__PLUGIN_DIR . '3rd-party/domain-mapping.php ' );
1314
1415// We can't load this conditionally since polldaddy add the call in class constuctor.
1516require_once ( JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php ' );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ if ( Jetpack_Constants::is_defined ( 'SUNRISE ' ) ) :
4+ function jetpack_domain_mapping_check_compatible_plugins () {
5+ // Once we've satisfied a condition for adding domain mapping compatibility, then bail
6+ $ hooked = jetpack_domain_mapping_maybe_support_wordpress_mu_domain_mapping ();
7+
8+ if ( ! $ hooked ) {
9+ jetpack_domain_mapping_maybe_add_wpmu_dev_domain_mapping_support ();
10+ }
11+ }
12+ add_action ( 'plugins_loaded ' , 'jetpack_domain_mapping_compatibility ' );
13+
14+ // Compatibility with Donncha's WordPress MU Domain Mapping plugin
15+ function jetpack_domain_mapping_maybe_support_wordpress_mu_domain_mapping () {
16+ if ( ! Jetpack_Constants::is_defined ( 'DOMAIN_MAPPING ' ) || function_exists ( 'domain_mapping_siteurl ' ) ) {
17+ return false ;
18+ }
19+
20+ add_filter ( 'jetpack_sync_home_url ' , 'domain_mapping_siteurl ' );
21+ add_filter ( 'jetpack_sync_site_url ' , 'domain_mapping_siteurl ' );
22+
23+ return true ;
24+ }
25+
26+
27+ // Compatibility with WPMU DEV's Domain Mapping plugin
28+ function jetpack_domain_mapping_maybe_add_wpmu_dev_domain_mapping_support () {
29+ if ( ! class_exists ( 'domain_map ' ) || ! method_exists ( 'domain_map ' , 'utils ' ) ) {
30+ return false ;
31+ }
32+
33+ $ utils = domain_map::utils ();
34+ add_filter ( 'jetpack_sync_home_url ' , array ( $ utils , 'swap_to_mapped_url ' ) );
35+ add_filter ( 'jetpack_sync_site_url ' , array ( $ utils , 'swap_to_mapped_url ' ) );
36+ }
37+ endif ;
You can’t perform that action at this time.
0 commit comments