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