Skip to content

Instantly share code, notes, and snippets.

View gspice's full-sized avatar

Ginger Coolidge gspice

  • GSC Solutions LLC
  • Lincoln City, Oregon
View GitHub Profile
@gspice
gspice / 1.php
Created April 4, 2019 20:33 — forked from amdrew/1.php
AffiliateWP - Send the affiliate registration admin email to different email address, or multiple email addresses.
<?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;
@gspice
gspice / v3-add-referral-url-to-donation-meta.php
Created March 11, 2025 21:34 — forked from rickalday/v3-add-referral-url-to-donation-meta.php
Adds referral URL to donations made on Visual Builder forms
<?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}
@gspice
gspice / make_comment_required.php
Created March 11, 2025 21:46 — forked from rickalday/make_comment_required.php
Make the Commens block field required in GiveWP forms
<?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);
@gspice
gspice / populate_v3_dropdown_from_url.php
Created March 31, 2025 21:04 — forked from rickalday/populate_v3_dropdown_from_url.php
Populate GiveWP v3 form dropdown from URL value
<?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
@gspice
gspice / export_gift_aid_names.php
Created April 1, 2025 18:30 — forked from rickalday/export_gift_aid_names.php
Export Gift Aid First and Last Names
<?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;