Plugin Directory

Changeset 3403243


Ignore:
Timestamp:
11/26/2025 10:52:51 AM (4 months ago)
Author:
pr24ch
Message:

Version 75

File:
1 edited

Legend:

Unmodified
Added
Removed
  • support-wp/tags/75/modules/tweaks/tweaks.php

    r3403234 r3403243  
    707707    function support_wp_wpml_fix_rewritebase($rules)
    708708    {
    709         $home_root = parse_url(home_url());
    710         if(isset($home_root['path']))
    711         {
    712             $home_root = trailingslashit($home_root['path']);
    713         }
    714         else
    715         {
    716             $home_root = '/';
    717         }
    718    
    719         $wpml_root = parse_url(get_option('home'));
    720         if(isset($wpml_root['path']))
    721         {
    722             $wpml_root = trailingslashit($wpml_root['path']);
    723         }
    724         else
    725         {
    726             $wpml_root = '/';
    727         }
    728    
    729         $rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);
    730         $rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);
     709        if(class_exists('SitePress'))
     710        {
     711            $home_root = parse_url(home_url());
     712            if(isset($home_root['path']))
     713            {
     714                $home_root = trailingslashit($home_root['path']);
     715            }
     716            else
     717            {
     718                $home_root = '/';
     719            }
     720       
     721            $wpml_root = parse_url(get_option('home'));
     722            if(isset($wpml_root['path']))
     723            {
     724                $wpml_root = trailingslashit($wpml_root['path']);
     725            }
     726            else
     727            {
     728                $wpml_root = '/';
     729            }
     730       
     731            $rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);
     732            $rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);
     733        }
    731734   
    732735        return $rules;
Note: See TracChangeset for help on using the changeset viewer.