Created
November 30, 2018 00:56
-
-
Save messica/fd9808f476450bd7a4e7d5e1ec577135 to your computer and use it in GitHub Desktop.
Hide Auto-Renewal Checkbox for Check payment
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 | |
/** | |
* 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