Last active
November 26, 2017 01:58
-
-
Save danieliser/4cd87090f338362d81e1 to your computer and use it in GitHub Desktop.
Schedule a popup.
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 | |
function schedule_my_popup( $is_loadable, $popup_id ) { | |
if( $popup_id == 123 ) { | |
$start = strtotime( 'May 4, 2015 11:59PM' ); | |
$end = strtotime( 'May 5, 2015 11:59PM' ); | |
$now = strtotime( 'now' ); | |
if( $now >= $start && $now <= $end ) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
} | |
return $is_loadable; | |
} | |
add_filter( 'popmake_popup_is_loadable', 'schedule_my_popup', 1000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment