Skip to content

Instantly share code, notes, and snippets.

@02Tea
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 02Tea/15baa109618caa16dc04 to your computer and use it in GitHub Desktop.
Save 02Tea/15baa109618caa16dc04 to your computer and use it in GitHub Desktop.
<?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