Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Last active July 24, 2020 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/26953a00fb537092a4767d746cfef690 to your computer and use it in GitHub Desktop.
Save dparker1005/26953a00fb537092a4767d746cfef690 to your computer and use it in GitHub Desktop.
Update PMPro Auto-Renewal Checkbox based on payment plan chosen (levels method).
<?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