Forked from messica/my_pmpropbc_enqueue_scripts.php
Last active
March 30, 2021 10:33
-
-
Save femiyb/f727b534b49eac325e96a3792e257559 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_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