Last active
January 22, 2024 15:59
-
-
Save MaximilianoRicoTabo/a2e3dd9c8a47da73ca41226626bf07c8 to your computer and use it in GitHub Desktop.
Let other forms submit in checkout page.
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 | |
/** | |
* Let Core checkout page have another forms and submit them. | |
* | |
* | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function custom_checkout() { | |
if( function_exists( 'pmpro_is_checkout' ) && pmpro_is_checkout() ) { | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
jQuery('form').submit(function(){ | |
if( $(this).attr('id') != 'pmpro_btn-submit' ) { | |
jQuery('#pmpro_btn-submit').removeAttr('disabled'); | |
jQuery('#pmpro_processing_message').css('visibility', 'hidden'); | |
} | |
}); | |
}); | |
</script> | |
<?php | |
} | |
} | |
add_action('wp_head', 'custom_checkout'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment