Skip to content

Instantly share code, notes, and snippets.

@rickalday
rickalday / shortcode-donor-wall.php
Created October 17, 2024 22:49
Custom Donor Wall Shortcode. If provided, it will display the Company name instead of the donor name.
<?php
/**
* This template is used to display the donation grid with [give_donor_wall]
*/
// Exit if accessed directly.
if (!defined('ABSPATH')) {
exit;
}
@rickalday
rickalday / v3-add-referral-url-to-donation-meta.php
Last active October 30, 2024 14:59
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}
@rickalday
rickalday / email_access_link.php
Created August 15, 2024 17:58
Customize Email Acess link tag {email_access_link}
@rickalday
rickalday / create_missing_givewp_tables.sql
Last active August 15, 2024 16:14
SQL commands to create some GiveWP tables
-- Change the wp_ prefix to match the WP prefix on your site
-- Create give_comments table
CREATE TABLE wp_give_comments (
comment_ID bigint(20) NOT NULL AUTO_INCREMENT,
user_id bigint(20) NOT NULL,
comment_content longtext NOT NULL,
comment_parent mediumtext NOT NULL,
comment_type mediumtext NOT NULL,
comment_date datetime NOT NULL,
comment_date_gmt datetime NOT NULL,
<?php
/**
* This template is used to display the donation grid with [give_form_grid]
* Insert this in a directory called 'give' in your theme's directory. A child theme is highly recommended
*/
// Exit if accessed directly.
use Give\Helpers\Form\Template;
use Give\Helpers\Form\Utils as FormUtils;
#: assets/dist/js/donor-dashboards-app.js:1
msgid "View Receipt"
msgstr ""
#: assets/dist/js/donor-dashboards-app.js:1
msgid "Count"
msgstr ""
#: assets/dist/js/donor-dashboards-app.js:1
msgid "Statement"
msgstr ""
#: assets/dist/js/donor-dashboards-app.js:1
@rickalday
rickalday / export-ffm-phone.php
Created June 21, 2024 00:10
Export FFM Phone
<?php
function export_option_givewp_ffm_phone() {
?>
<tr class="give-export-option-fields give-export-option-custom-field">
<td scope="row" class="row-title">
<label><?php esc_html_e( 'Phone Number:', 'give' ); ?></label>
</td>
<td class="give-field-wrap">
<div class="give-clearfix">
@rickalday
rickalday / give_upgrades_donor_name.php
Last active June 19, 2024 14:39
Fixes GiveWP issue with missing firstName
<?php
function give_upgrades_donor_name() {
// Adjust the number in the next line if you have more than 9999 donors
$donors = Give()->donors->get_donors(['number' => 9999,]);
if ( $donors ) {
// Loop through Donors
foreach ( $donors as $donor ) {
@rickalday
rickalday / give_export_transaction_id.php
Created March 1, 2024 17:14
Add a checkbox to export the donation Transaction ID in GiveWP donation history export
<?php
function give_export_transaction_id() {
?>
<tr class="give-export-option-fields give-export-option-custom-field">
<td scope="row" class="row-title">
<label><?php esc_html_e( 'Transaction ID:', 'give' ); ?></label>
</td>
<td class="give-field-wrap">
<div class="give-clearfix">
@rickalday
rickalday / export_option_givewp_mc_fields.php
Last active October 17, 2023 16:19
Export Mailchimp status in GiveWP
<?php
function export_option_givewp_mc_fields() {
?>
<tr class="give-export-option-fields give-export-option-custom-field">
<td scope="row" class="row-title">
<label><?php esc_html_e( 'MailChimp:', 'give' ); ?></label>
</td>
<td class="give-field-wrap">
<div class="give-clearfix">