Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save femiyb/f727b534b49eac325e96a3792e257559 to your computer and use it in GitHub Desktop.

Select an option

Save femiyb/f727b534b49eac325e96a3792e257559 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_autorenewal_checkbox').hide();
jQuery('#autorenew_present').val(0);
} else {
jQuery('#pmpro_autorenewal_checkbox').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