Skip to content

Instantly share code, notes, and snippets.

@danieliser
Last active November 26, 2017 01:58
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 danieliser/4cd87090f338362d81e1 to your computer and use it in GitHub Desktop.
Save danieliser/4cd87090f338362d81e1 to your computer and use it in GitHub Desktop.
Schedule a popup.
<?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