Last active
August 29, 2015 14:06
-
-
Save 02Tea/15baa109618caa16dc04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|------------------------------------------ | |
| Disable Auto Dual Optin Popup form | |
|------------------------------------------ | |
| | |
| disable pop-up opt-in if Page Dual Opt-in -> Disable dual opt-in pop-up is == Yes | |
| for pages only. | |
| | |
| @for hawkgroupmedia-dev | |
| @site French Cuffy | |
| @file page.php | |
| | |
*/ | |
$acf_field = get_field('disable_dual_opt-in_pop-up'); | |
$disable_dual_opt_in_pop_up = in_array( 'yes', $acf_field) ? 'yes' : 'no'; | |
if($disable_dual_opt_in_pop_up == 'yes') : ?> | |
<script type="text/javascript"> | |
(function($){ | |
$(window).bind("load", function() { | |
$('body').addClass('pop-up-disabled'); | |
$('.pop-up-disabled a[data-reveal-id]').attr('data-reveal-id','data-dont-reveal-id'); | |
$('.pop-up-disabled .epoi-box').hide(); | |
}); | |
})(jQuery); | |
</script> | |
<?php elseif($disable_dual_opt_in_pop_up == 'no') :?> | |
<?php endif; | |
/* | |
|------------------------------------------ | |
| EOF Disable Auto Dual Optin Popup form | |
|------------------------------------------ | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment