Created
May 17, 2019 17:21
-
-
Save LMNTL/7bbd506f80110dc1b053a6d25f909b31 to your computer and use it in GitHub Desktop.
example of adding Javascript to run after the checkout button is clicked with PMPro
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
// example of adding Javascript to run after the checkout button is clicked | |
function my_pmpro_js_on_submit() { | |
?> | |
<script> | |
jQuery(document).ready( function(){ | |
jQuery("#pmpro_form").submit( function(){ | |
alert("hello world!"); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('pmpro_checkout_after_form', 'my_pmpro_js_on_submit'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment