From e3c4b9c188f11967e7c3c974b6de91982b748609 Mon Sep 17 00:00:00 2001 From: g <> Date: Thu, 24 Sep 2020 11:26:42 +0300 Subject: [PATCH 1/2] LAW-3631 fix wp menu links --- htdocs/wp-content/themes/lawcarta/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/wp-content/themes/lawcarta/functions.php b/htdocs/wp-content/themes/lawcarta/functions.php index 4c12677..765b4a6 100644 --- a/htdocs/wp-content/themes/lawcarta/functions.php +++ b/htdocs/wp-content/themes/lawcarta/functions.php @@ -208,12 +208,16 @@ function get_lawcarta_url(){ if (defined('LAWCARTA_SUBDOMAIN')) { $hostParts = explode('.', $host); if (count($hostParts) === 3) { - array_shift($hostParts); + $wp_sub_domain = array_shift($hostParts); } if (!empty(LAWCARTA_SUBDOMAIN)) { array_unshift($hostParts, LAWCARTA_SUBDOMAIN); } $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); + } } $port = isset($urlParts['port']) ? $urlParts['port'] : ''; From 531f9217a46a6fddf4c64131b389614e55c03e28 Mon Sep 17 00:00:00 2001 From: g <> Date: Thu, 24 Sep 2020 11:28:08 +0300 Subject: [PATCH 2/2] LAW-3631 fix wp menu links --- htdocs/wp-content/themes/lawcarta/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/wp-content/themes/lawcarta/functions.php b/htdocs/wp-content/themes/lawcarta/functions.php index 765b4a6..18129cd 100644 --- a/htdocs/wp-content/themes/lawcarta/functions.php +++ b/htdocs/wp-content/themes/lawcarta/functions.php @@ -215,7 +215,7 @@ 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'){ + if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){ $host = str_replace('staging-law', 'staging-live',$host); } }