Skip to content

Instantly share code, notes, and snippets.

@messica
Created November 30, 2018 00:56
Show Gist options
  • Save messica/fd9808f476450bd7a4e7d5e1ec577135 to your computer and use it in GitHub Desktop.
Save messica/fd9808f476450bd7a4e7d5e1ec577135 to your computer and use it in GitHub Desktop.
Hide Auto-Renewal Checkbox for Check payment
<?php
/**
* Hide Auto-Renewal Checkbox for Check payment
*/
function my_pmpropbc_enqueue_scripts() {
global $pmpro_pages;
if(is_page($pmpro_pages['checkout'])) {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('input[name=gateway]').change(function() {
if(jQuery(this).val() == 'check') {
jQuery('.pmpro_checkout_field-autorenew').hide();
jQuery('#autorenew_present').val(0);
} else {
jQuery('.pmpro_checkout_field-autorenew').show();
jQuery('#autorenew_present').val(1);
}
});
});
</script>
<?php
}
}
add_action('wp_footer', 'my_pmpropbc_enqueue_scripts');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment