Charitable Documentation

Learn how to make the most of Charitable with clear, step-by-step instructions.

Charitable_Donor

The Charitable_Donor class allows you to get access to information about a particular donor.

Getting an instance of Charitable_Donor

A Charitable_Donor instance can be retrieved in different ways depending on the context in which you need to use it.

With a donor ID

$donor_id = 123;
$donor    = new Charitable_Donor( $donor_id );

With a donor ID and a donation ID

$donor_id    = 123;
$donation_id = 456;
$donor       = new Charitable_Donor( $donor_id, $donation_id );

With a donation object or ID

// If you have a donation ID, first get the Charitable_Donation object.
$donation_id = 123;
$donation    = charitable_get_donation( $donation_id );

// Get the Charitable_Donor object.
$donor = $donation->get_donor();

With a Charitable_User object

// If you have a user ID, first get the Charitable_User object.
$user_id = 123;
$user    = charitable_get_user( $user_id );

// Now get the donor ID.
$donor_id = $user->get_donor_id();

// Instantiate the Charitable_Donor object with the donor ID.
$donor = new Charitable_Donor( $donor_id );

Properties

user_id
The user ID for the donor. For unregistered donors, this will return 0.

first_name
The donor’s first name.

last_name
The donor’s last name.

email
The donor’s email address.

date_joined
The date the donor first became a donor. This will be returned as a MySQL date time string.

date_erased
The date in MySQL date time that the donor’s information was erased. This is only populated if there was a data erasure request for the donor’s email address.

contact_consent
Whether the donor has opted to give their consent to be contacted.

Methods

get_user()

This returns the Charitable_User object associated with this donor.

get_donation()

If you instantiated Charitable_Donor with a donation ID or with the get_donor() method of Charitable_Donation, get_donation() will return the instance of Charitable_Donation.

Otherwise, this will return false.

get_donations()

This will return an array of all donations made by the donor.

get_donor_meta( $key = '' )

Return the donor meta stored for the particular donation.

Params
$key
If set, this will return the meta value for the given key, or false if no such meta value exists. If left empty, this will return an array of all the donor meta.

get_last_donation()

Returns the donor’s most recent donation as a Charitable_Donation instance, or null if they have not made a donation.

get_name()

Returns the donor’s name stored for the particular donation.

get_email()

Returns the donor’s email address.

has_valid_email()

Returns whether the donor’s supplied email address is valid.

get_address()

Returns the donor’s printable address.

This is a wrapper for Charitable_User::get_address().

get_avatar( $size = 100 )

Returns the HTML to display the donor’s avatar. By default, this will return the Gravatar associated with the donor’s email address.

This is a wrapper for Charitable_User::get_avatar().

Params
$size
Optional. Sets the width & height of the avatar to return. By default, the avatar is returned with a width and height of 100px.

get_location()

Returns the donor’s location.

If the Charitable_Donor object was not called with a $donation_id set, this returns the result of Charitable_User::get_location(). Otherwise, this will return the location provided for the donation, based on the city, state and/or country.

get_amount( $campaign_id = false )

Return the donation amount.

If a donation ID was passed when the Charitable_Donor was instantiated, this will return the total donated with this particular donation. Otherwise, this will return the total amount ever donated by the donor.

Params
$campaign_id
Optional. If set, this will only return the amount donated to the given campaign.

Still have questions? We’re here to help!

Last Modified:

What's New In Charitable

View The Latest Updates
🔔 Subscribe to get our latest updates
📧 Subscribe to Emails

Email Subscription

Join our Newsletter

We won’t spam you. We only send an email when we think it will genuinely help you. Unsubscribe at any time!

Improvement Payments

📱 Turn Mobile Scrollers Into Donors: Meet Charitable’s Mollie Upgrade

Losing mobile supporters because they hate typing out long card numbers on their phones? Charitable’s updated Mollie integration features:

⚡ One-Tap Wallet Checkout: Enable donors to complete their gifts instantly using Apple Pay or Google Pay with a simple face scan, fingerprint, or tap.

💰 No Extra PCI Burden: Skip complex domain verification and security compliance since all wallet transactions run safely through Mollie’s hosted checkout.

🛠️ Custom Cancel Routing: Keep the experience predictable by automatically sending donors who back out to your cancellation page, or use developer filters to route them to a custom page.

Visit this page to learn more.

ambassadors improved New

Moderation and Directory Screens In Ambassadors 3.0

Ambassadors 3.0 has new features: moderation and directory screens… now easily see those who are earning donations on your peer to peer network – including campaign creators that might need to be verified – all in one place. Generate reports, email ambassadors and campaign creators directly and more.

🚀 See when campaign creators and ambassadors have updated their campaigns, what donors/donation they have brought in and more.

🎉 Manually add ambassadors and campaign creators, and approve them in one-click!

Visit this page to learn more.

New Payments

⚡ Unlock India-Based Donations: Meet Charitable’s Native Razorpay Integration

Trying to collect donations in India? Charitable’s native Razorpay integration features:

⚡ Instant UPI Integration: Accept fast, local donations directly inside your form via apps like PhonePe, Google Pay, Paytm, and BHIM without sending donors away from your site.

📲 Auto-Generated Campaign QRs: Instantly render scannable QR codes encoding a UPI deep link directly on your public campaign pages and sidebars for an effortless “scan-to-give” experience.

💰 Dual Local & Global Reach: Headline your campaigns in INR while seamlessly accepting major international currencies like USD, EUR, GBP, and CAD to maximize global support.

🔁 Seamless Recurring Giving: Fully integrates with the Charitable Recurring addon to manage automatic monthly subscriptions directly through Razorpay without extra code.

↩️ Automatic Two-Way Sync: Keep your books perfectly clean with two-way refund syncing—issue a refund inside WordPress or your Razorpay dashboard and both sides update automatically.

🔒 Webhook-Verified Security: Automatically protect your donation records using HMAC-signed webhook verification to ensure every status update represents real money cleared on the rails.

Visit this page to learn more.

Integration New

🎉 New Built-in PushEngage Integration

Struggling with falling email open rates and rising ad costs just to keep your supporters engaged? Charitable’s built-in PushEngage integration features:

🔔 Zero-Fee Direct Messaging: Deliver crisp, instant pop-up notifications straight to your donors’ desktops and mobile devices.

⏱️ Four Smart Automated Triggers: Automatically send updates for immediate donation thank yous, full-list campaign launches, urgent “ending soon” alerts, and goal milestone celebrations.

📈 Group Momentum Broadcasts: Turn private milestones into public wins by automatically broadcasting alerts to your entire subscriber list the moment a campaign hits 50%, 75%, or 100% of its goal.

📊 Automatic Analytics Tracking: Monitor exactly where your incoming notification traffic is coming from with built-in attribution that requires zero complex configuration.

Visit this page to learn more.

New Security

💂‍♂️ New DonationGuard 🛡️ Automatically Protects Your Donations!

Worried about card testing attacks or spam bots flooding your donation forms, but don’t want to ruin the giving experience for your real supporters? Charitable’s DonationGuard features:

🛡️ Real-Time Bot Detection: Actively monitors every donation submission for five distinct attack signals without slowing down your human donors.

📊 Smart Traffic Scoring: Instantly evaluates activity against a learned baseline of your site’s normal donation rhythms to catch sneaky, slow-drip card testing.

🚨 Severity-Tiered Alerts: Immediately opens structured “Attack Records” and notifies you via email and admin alerts the moment a campaign starts taking fire.

🎯 Single-Click Defense: Deploy instant security using the “Recommended Settings” preset to turn on Honeypot, Time Trap, and Rate Limit modules all at once.

🚫 Automated Blocklists: Permanently stop repeat offenders by automatically blocking suspicious email addresses based on your customized rules.

Visit this page to learn more.