Skip to content

Instantly share code, notes, and snippets.

<?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;
}
// 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;
}
add_action( 'wp_nav_menu_item_custom_fields', '_my_custom_nav_menu_fields', 10, 4 );
function _my_custom_nav_menu_fields( $item_id, $item, $depth, $args ) {
wp_nonce_field( 'pum-menu-editor-nonce', 'pum-menu-editor-nonce' ); ?>
<p class="field-popup_id description description-wide">
<label for="edit-menu-item-popup_id-<?php echo $item->ID; ?>">
<?php _e( 'Trigger a Popup', 'popup-maker' ); ?><br />
<select name="menu-item-pum[<?php echo $item->ID; ?>][popup_id]" id="edit-menu-item-popup_id-<?php echo $item->ID; ?>" class="widefat edit-menu-item-popup_id">
function custom_nav_menu_walker( $walker ) {
global $wp_version;
// Here to prevent false warnings from If Menu and plugins that notify you of nav menu walker replacement.
if ( doing_filter( 'plugins_loaded' ) ) {
return $walker;
}
// Return early if another plugin/theme is using the same custom fields walker we are. We are already compatible.
if ( $walker == 'Walker_Nav_Menu_Edit_Custom_Fields' ) {
return $walker;
<?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 () {