Skip to content

Instantly share code, notes, and snippets.

<?php
function schedule_my_popup( $is_loadable, $popup_id ) {
if( $popup_id == 123 ) {
$start = strtotime( 'May 4, 2016 11:59AM' );
$end = strtotime( 'May 5, 2016 11:59AM' );
$now = strtotime( 'now' );
if( $now >= $start && $now <= $end ) {
return true;
<?php
add_action( 'wp_footer', 'hoc_popup_reg_form_check', 1000 );
function pum14_popup_reg_form_check() {
if ( isset( $_POST['form_id'] ) && $_POST['form_id'] == 'my_form' ) {
?>
<script type="text/javascript">
jQuery('#pum-123').animate({'scrollTop': 0}, 1000);
</script>
<?php
}
html.pum-open.pum-open-overlay.pum-open-fixed .pum-overlay {
overflow: hidden;
position: fixed;
width: 100%;
}
html.pum-open.pum-open-overlay.pum-open-scrollable .pum-overlay.pum-active {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
.pum-open-overlay.pum-open-scrollable {
margin-right: 17px;
}
.pum-open-overlay.pum-open-scrollable body {
position: relative;
}
html.pum-open.pum-open-overlay.pum-open-scrollable body>[aria-hidden] {
padding-right: inherit;
.pum-open-overlay.pum-open-scrollable {
margin-right: 17px;
position: relative;
}
html.pum-open.pum-open-overlay.pum-open-scrollable body>[aria-hidden] {
padding-right: inherit;
}
<?php
add_action( 'wp_footer', 'my_custom_popup_scripts', 500 );
function my_custom_popup_scripts() { ?>
<script type="text/javascript">
(function ($, document, undefined) {
jQuery('#pum-123')
.on('pumAfterOpen', function () {
// Priority of 11 is important, WP overwrites anything before that.
add_filter( 'manage_nav-menus_columns', '_my_nav_menu_columns', 11 );
function _my_nav_menu_columns( $columns = array() ) {
$columns['popup_id'] = __( 'Popup', 'popup-maker' );
return $columns;
}