Skip to content

Instantly share code, notes, and snippets.

@danieliser
Last active September 26, 2016 23:00
Show Gist options
  • Select an option

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

Select an option

Save danieliser/961f5d5746acabe7e4b1 to your computer and use it in GitHub Desktop.
This will work with any of the Popup Maker newsletter integration extensions. This will close the popup when the form is submitted successfully.
<?php
add_action( 'wp_footer', 'my_custom_popup_scripts', 500 );
function my_custom_popup_scripts() { ?>
<script type="text/javascript">
(function ($) {
$('.pum_sub_form').on('pumNewsletterSuccess pumNewsletterErrorAlreadySubscribed', function () {
$(this).parents('.popmake').popmake('close');
});
}(jQuery))
</script><?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment