Plugin Directory

Changeset 1462773


Ignore:
Timestamp:
07/29/2016 01:54:16 AM (10 years ago)
Author:
AmitDeyUS
Message:

Added fix for URLs with "www" not apending siteName correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • marketpowerwp/trunk/src/Multisoft/MPP/Replication/ReplicationController.php

    r1460432 r1462773  
    3737        $this->add_action('admin_notices', 'mppe_replication_message');
    3838        $this->add_shortcode('mppe', 'mppe_replication_info');
    39         $this->add_filter('option_siteurl', 'replication_site_url');
    40         $this->add_filter('option_home', 'replication_home_url');
     39        if (!defined('WP_HOME')) {
     40            $this->add_filter('option_home', 'replication_home_url');
     41        }
     42        if (!defined('WP_SITEURL')) {
     43            $this->add_filter('option_siteurl', 'replication_site_url');
     44        }
    4145
    4246        if (MPP_DEBUG) {
     
    6165            [$this, 'index']
    6266        );
    63 
    64         ob_start();
    65         add_action('shutdown', function () {
    66             $final = '';
    67             $levels = ob_get_level();
    68 
    69             for ($i = 0; $i < $levels; $i++) {
    70                 $final .= ob_get_clean();
    71             }
    72             echo apply_filters('final_output', $final);
    73         }, 0);
    74         $this->add_filter('final_output', 'mppe_autoprefix_content');
     67        if (!is_admin()) {
     68            ob_start();
     69            add_action('shutdown', function () {
     70                $final = '';
     71                $levels = ob_get_level();
     72
     73                for ($i = 0; $i < $levels; $i++) {
     74                    $final .= ob_get_clean();
     75                }
     76                echo apply_filters('final_output', $final);
     77            }, 0);
     78            $this->add_filter('final_output', 'mppe_autoprefix_content');
     79        }
    7580
    7681    }
     
    198203
    199204        $xxx = $replicationGateway->get_replication_site_name();
     205        if($xxx == 'admin') {
     206            return $output;
     207        }
    200208        $host = Utils::get_domain(site_url());
    201209        $web_address_host = Utils::get_domain($settingsGateway->get(CoreController::OPTION_WEB_ADDRESS));
Note: See TracChangeset for help on using the changeset viewer.