Last active
September 8, 2020 13:40
-
-
Save matheuswd/01dcefdf3c52c154954783a3c445ab8e to your computer and use it in GitHub Desktop.
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 | |
function hide_recurring_option_for_offline_payment() { ?> | |
<script> | |
let paymentMethodOff = jQuery('input[value="offline"]'); | |
let recurringOption = jQuery('div.give-recurring-donors-choice'); | |
let recurringData = jQuery('input[name="_give_is_donation_recurring"]'); | |
if(true === paymentMethodOff.prop('checked')) { | |
recurringOption.prop('checked', false); | |
recurringData.prop('value', 0); | |
recurringOption.hide(); | |
} else { | |
recurringOption.show(); | |
} | |
</script> | |
<?php | |
} | |
add_action( 'give_donation_form_after_submit', 'hide_recurring_option_for_offline_payment' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment