-
-
Save andrewlimaza/2d4ac6c391804130304510e3274a936f to your computer and use it in GitHub Desktop.
Remove Auto Renewal Checkbox if check is selected.
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 this code to your PMPro Customizations Plugin or Code Snippet plugin. | |
function my_footer_script() { | |
global $pmpro_pages; | |
if ( is_page($pmpro_pages['checkout'] ) ) { | |
?> | |
<script> | |
jQuery(document).ready(function(){ | |
jQuery('#pmpro_payment_method input').on('click', function(){ | |
if ( jQuery(this).val() == 'check' ) { | |
jQuery('#pmpro_autorenewal_checkbox').hide(); | |
jQuery('.pmpro_checkout_field-autorenew #autorenew').prop('checked', false ); | |
} else { | |
jQuery('#pmpro_autorenewal_checkbox').show(); | |
} | |
}); | |
}); | |
</script> | |
<?php | |
} // end of if statement | |
} | |
add_action( 'wp_footer', 'my_footer_script' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment