Skip to content

Instantly share code, notes, and snippets.

@danieliser
Created September 20, 2015 19:35
Show Gist options
  • Select an option

  • Save danieliser/e34a156e3da722437912 to your computer and use it in GitHub Desktop.

Select an option

Save danieliser/e34a156e3da722437912 to your computer and use it in GitHub Desktop.
Disable auto open for a popup if $_GET parameter is missing or empty.
<?php
add_action( 'popmake_get_the_popup_data_attr', 'my_custom_popup_data_attr', 10, 2 );
function my_custom_popup_data_attr( $data_attr, $popup_id ) {
if ( $popup_id == 123 && empty( $_GET['popup'] ) ) {
unset( $data_attr['meta']['auto_open'] );
}
return $data_attr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment