Merge pull request #6557 from Jerryby/wordpress

home page early redirect
This commit is contained in:
gregory-p
2022-04-18 20:46:13 +04:00
committed by GitHub

View File

@@ -34,6 +34,20 @@ $scripts = [];
var isHomeTemplate = true;
</script>
<?php endif;?>
<script>
(function(){ // early redirect if needed
if (typeof frontSettings === 'undefined' || frontSettings.isGuest) return;
if (typeof isHomeTemplate != 'undefined' && isHomeTemplate === true) {
var urlParams = new URLSearchParams(window.location.search);
var redirectGetParam = urlParams.get('law') ? '?law=1' : '';
window.location.href = lawCartaDomain + '/dashboard' + redirectGetParam;
}
})();
</script>
<?php $scripts[] = ['type' => 'script', 'source' =>"https://www.googleoptimize.com/optimize.js?id=OPT-TCXZSGK"]; ?>
<?php if (LAWCARTA_ENVIRONMENT_NAME == 'prod'):?>
<?php $scripts[] = ['type' => 'comment', 'source' =>'Google Tag Manager']; ?>