From 64ffe537e358f322ec47055239233d064dcede95 Mon Sep 17 00:00:00 2001 From: Gregory Pradun Date: Thu, 29 Jul 2021 16:16:15 +0300 Subject: [PATCH] LAW-4359 --- htdocs/wp-content/themes/lawcarta/functions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/wp-content/themes/lawcarta/functions.php b/htdocs/wp-content/themes/lawcarta/functions.php index 138ee4c..268900f 100644 --- a/htdocs/wp-content/themes/lawcarta/functions.php +++ b/htdocs/wp-content/themes/lawcarta/functions.php @@ -354,4 +354,13 @@ add_filter( 'robots_txt', function( $output, $public ) { return $output; -}, 99, 2 ); // Priority 99, Number of Arguments 2. \ No newline at end of file +}, 99, 2 ); // Priority 99, Number of Arguments 2. + +function mark_redirected_user(){ + + if(isset($_GET['law']) && $_GET['law'] == 1){ + $cookieDomain = (LAWCARTA_ENVIRONMENT_NAME == 'local') ? 'livecarta.loc' : 'livecarta.com'; + setcookie('law_'.LAWCARTA_ENVIRONMENT_NAME, 1,0,"/", $cookieDomain); + } +} +add_action( "template_redirect", "mark_redirected_user" ); \ No newline at end of file