Last active
September 26, 2016 23:00
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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