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 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' ); |
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 custom_text_below_title() { | |
echo '<h2>my custom subtitle</h2>'; | |
} | |
add_action( 'give_before_template_part', 'custom_text_below_title' ); |
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 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' ); |
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 my_checked_create_account() { ?> | |
<script> | |
jQuery("input[name=give_create_account]").prop("checked", true); | |
</script> | |
<?php } | |
add_action( 'give_donation_form_after_submit', 'my_checked_create_account' ); |
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 | |
/** | |
* A local translation snippet specifically for the Donor's choice checkbox. Change 'YOUR TEXT HERE' to your desired text. | |
* | |
* @param $translations | |
* @param $text | |
* @param $domain | |
* | |
* @return string | |
*/ |
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 my_give_limit_zip_length() { ?> | |
<script> | |
let zipcodes = document.querySelectorAll('input#card_zip'); | |
zipcodes.forEach(zipcode => zipcode.setAttribute('maxlength', 5)); | |
</script> | |
<?php } |
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 my_give_text_switcher( $translation, $text, $domain ) { | |
if ( 'give-recurring' === $domain ) { | |
switch ( $translation ) { | |
/* | |
* Changes the "Make this Donation [monthly/weekly/daily]" text for | |
* a donor's choice recurring checkbox. | |
*/ | |
case 'Make this donation %1$s' : | |
$translation = __( 'Make this membership automatically renew %1$s', 'give' ); |
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 | |
/** | |
* Implementing Google's ReCaptcha on specific GiveWP Forms | |
* | |
* To effectively use this snippet, please do the following: | |
* 1. Get your Google ReCAPTCHA API Key here: https://www.google.com/recaptcha/ | |
* 2. In each function and action, replace "_myprefix_" with your own custom prefix | |
* 3. Put your "Secret Key" where it says "MYSECRETKEY" in the $recaptcha_secret_key string | |
* 4. Put your "Site Key" where it says "MYSITEKEY" in TWO areas below | |
*/ |
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 | |
// Changes the format for the amount raised | |
function change_amount_raised_goal_decimal($form_currency) { | |
$income_format_args = array( | |
'sanitize' => false, | |
'currency' => $form_currency, | |
'decimal' => true, | |
); | |
} |
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 gift_aid_default_checked() { ?> | |
<script> | |
jQuery("input[name=give_gift_aid_accept_term_condition]").prop("checked", true); | |
</script> | |
<?php } | |
add_action( 'give_donation_form_after_submit', 'gift_aid_default_checked' ); |