Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matheuswd/3d1f03e88fa2fc225f1c921dbd8a6baf to your computer and use it in GitHub Desktop.
Save matheuswd/3d1f03e88fa2fc225f1c921dbd8a6baf to your computer and use it in GitHub Desktop.
Hides the donate button for offline donations
<?php
/**
Hides the donate button for offline donation
*/
function my_give_hide_button() { ?>
<script>
let gatewayOfflineChecked = jQuery(".give-gateway-option-selected input[value='offline']").prop("value");
if(gatewayOfflineChecked) {
document.querySelectorAll('.give-submit-button-wrap')[0].style.display = 'none';
}
</script>
<?php }
add_action( 'give_donation_form_after_submit', 'my_give_hide_button' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment