Skip to content

Instantly share code, notes, and snippets.

@matheuswd
Created April 8, 2021 15:46
Show Gist options
  • Save matheuswd/4110bee3cf46d919527fc94f0260e140 to your computer and use it in GitHub Desktop.
Save matheuswd/4110bee3cf46d919527fc94f0260e140 to your computer and use it in GitHub Desktop.
This codes makes the Mailchimp checkbox to be required by default. The user will not be able to donate without checking the newsletter checkbox.
<?php
function required_givewp_mailchimp() { ?>
<script>
jQuery("input[name=give_mailchimp_signup]").prop("required", true);
</script>
<?php }
add_action( 'give_donation_form_after_submit', 'required_givewp_mailchimp' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment