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 | |
/** | |
* Send admin notification to a different email address | |
*/ | |
function affwp_custom_registration_admin_email( $email ) { | |
// add the email here | |
$email = '[email protected]'; | |
return $email; |
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 | |
// Adds a hidden field to the form that stores the URL | |
add_action('givewp_donation_form_schema', static function (Give\Framework\FieldsAPI\DonationForm $form) { | |
$field = Give\Framework\FieldsAPI\Hidden::make('referralUrl') | |
->defaultValue($_SERVER['HTTP_REFERER']) | |
->emailTag('referralUrl'); | |
$form->insertAfter('email', $field); | |
}); | |
// (Optional) Use this email tag in the email templates {meta_donation_referralUrl} |
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 | |
add_action('givewp_donation_form_schema', function($form) { | |
$comment = $form->getNodeByName('comment'); | |
// if the comment field is not found, return | |
if (!$comment) { | |
return; | |
} | |
// require field | |
$comment->required(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 | |
add_action('givewp_donation_form_schema', function($form) { | |
//Get field by name attribute | |
$field = $form->getNodeByName('field_name_here'); | |
// if the field is not found, return | |
if (!$field) { | |
return; | |
} | |
// get the current default value |
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 | |
add_filter( 'give_gift_aid_export_get_data', static function($data) { | |
foreach($data as $key => $datakey){ | |
$first_name = give_get_payment_meta($datakey['gift_aid_donation_id'], '_give_donor_billing_first_name', true); | |
$last_name = give_get_payment_meta($datakey['gift_aid_donation_id'], '_give_donor_billing_last_name', true); | |
$data[$key]['gift_aid_first_name'] = $first_name; | |
$data[$key]['gift_aid_last_name'] = $last_name; | |
} | |
return $data; |
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 | |
use GiveFunds\Models\Fund; | |
use GiveFunds\Repositories\Funds; | |
use GiveFunds\Repositories\Revenue; | |
function give_include_fund_payment_meta( $charge_args ) { | |
if ( ! defined( 'GIVE_FUNDS_ADDON_VERSION' )) { | |
return; |
OlderNewer