From 0caf6a41a9833150330065ae52070da32a98e43d Mon Sep 17 00:00:00 2001 From: atsaruk Date: Wed, 16 Oct 2024 16:26:27 +0200 Subject: [PATCH] LAW-8010 --- .../wp-content/themes/lawcarta/functions.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/wp-content/themes/lawcarta/functions.php b/htdocs/wp-content/themes/lawcarta/functions.php index de47f60..a83113e 100644 --- a/htdocs/wp-content/themes/lawcarta/functions.php +++ b/htdocs/wp-content/themes/lawcarta/functions.php @@ -226,16 +226,19 @@ function get_lawcarta_url(){ } $host = implode('.', $hostParts); //Fix for staging env because of it use same domain carta.live for both lawcarta/livecarta - if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){ - $host = str_replace('staging-law', 'staging-live',$host); - } - //Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta - if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == 'prod-live'){ - $host = str_replace('prod-law', 'prod-live',$host); - } - //Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta - if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == ''){ - $host = str_replace('app-law', 'app',$host); + + if (isset($wp_sub_domain)) { + if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){ + $host = str_replace('staging-law', 'staging-live',$host); + } + //Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta + if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == 'prod-live'){ + $host = str_replace('prod-law', 'prod-live',$host); + } + //Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta + if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == ''){ + $host = str_replace('app-law', 'app',$host); + } } }