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 / 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;
@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 / 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 / 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 / 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 / gist:f90fc70372a74a14fddaabbfcba64d81
Created March 12, 2019 20:13 — forked from pippinsplugins/gist:d973776836ab984aea06
Sets an affiliate user's role to a specific role when being added as an affiliate
<?php
/*
* Plugin name: Affiliate role on registration
*/
function pw_affwp_set_role_on_registration( $affiliate_id = 0 ) {
$user_id = affwp_get_affiliate_user_id( $affiliate_id );
$user = new WP_User( $user_id );
$user->add_role( 'affiliate' );
@gspice
gspice / affwp-pms-restrict-referral.php
Created November 8, 2018 17:34 — forked from tubiz/affwp-pms-restrict-referral.php
Allows you to restrict referral creation to specific PMS subscription plans
<?php
/**
* Plugin Name: AffiliateWP - Restrict Referral Creation To Specific PMS Subscription Plans
* Plugin URI: http://affiliatewp.com
* Description: Allows you to restrict referral creation to specific PMS subscription plans
* Author: Tunbosun Ayinla, tubiz
* Author URI: https://bosun.me
* Version: 1.0
*/
@gspice
gspice / _header-scss
Created March 6, 2017 00:41 — forked from jdelia/_header-scss
Adding SVG Logo to Utility Pro theme
.header-image .site-title a {
background: url(images/logo.svg) center center no-repeat;
float: left;
min-height: 60px;
width: 100%;
@include media($medium-screen-up) {
background-position: left center;
}
}
<?php
/**
* Genesis Sample.
*
* This file adds functions to the Genesis Sample Theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0+
* @link http://www.studiopress.com/
@gspice
gspice / if-resolution.scss
Created February 9, 2016 20:51 — forked from ffdead/if-resolution.scss
SASS resolution media query mixin
/* @author 14islands.com
* SASS mixins for future proof resolution media query
*/
@mixin if-min-resolution($dppx) {
@include if-resolution(min, $dppx) {
@content;
}
}