Last active
July 24, 2020 14:28
-
-
Save dparker1005/26953a00fb537092a4767d746cfef690 to your computer and use it in GitHub Desktop.
Update PMPro Auto-Renewal Checkbox based on payment plan chosen (levels method).
This file contains 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 | |
// Copy from below here... | |
/* | |
* Update PMPro Auto-Renewal Checkbox based on payment plan chosen (levels method). | |
*/ | |
function my_pmproarc_update_checkbox_label() { | |
?> | |
<script> | |
jQuery(document).ready(function() { | |
jQuery('input[name ="level"]').click(function() { | |
jQuery('.pmpro_checkout_field-autorenew > label').text('Yes, renew at ' + jQuery('label[for ="' + this.id + '"]').text()); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'pmpro_checkout_boxes', 'my_pmproarc_update_checkbox_label' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment