Skip to content

Instantly share code, notes, and snippets.

@LMNTL
Created May 17, 2019 17:21
Show Gist options
  • Save LMNTL/7bbd506f80110dc1b053a6d25f909b31 to your computer and use it in GitHub Desktop.
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
// 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