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!

Campaigns New

🧡 Modal Donate Button: Turn Any Click into a Contribution

Instead of redirecting users to a new URL, the lightweight Modal Donation Button allows donors to complete their gift in a sleek, focused popup, keeping them engaged with your content while they support your cause.

What’s New:

  • Zero-Friction Giving: Open your donation form in a responsive modal overlay. Donors stay on the same page, reducing drop-off.

  • 🖱️ Place it Anywhere: Use the dedicated WordPress block or a simple shortcode to drop a donate button into sidebars, footers, or even mid-sentence in your storytelling.

  • 🎨 Full Design Control: Match your brand perfectly with customizable background colors, hover effects, border radius, and font sizes—all without touching a single line of CSS.

Whether you need a simple “Donate Now” link or a high-converting popup button, the Modal Donate Button gives you the flexibility to raise more with less effort.

donation form Donations New

💵 Mini Donation Widget: Show The Impact Of Every Dollar!

Not every donor who wants to give will navigate to your campaign page. Meet them exactly where they are by placing a fully functional giving experience directly on any page or post.

💬 Show the impact of every dollar: Attach custom messages to each preset amount so donors understand exactly what their gift provides.
🔄 Monthly and one-time giving: Supports a tabbed interface with independent amounts and impact statements for recurring giving programs.
🎨 Match your brand: Easily set accent colors and control size or alignment to fit the widget naturally into your layout without CSS.
⚡ Reduce donor friction: Open the donation form in a modal overlay to keep donors on the page and reduce drop-off.

Donations Live New

👉🏻 Showcase Real Momentum with the Donations Feed

Give your donors a reason to trust. Our new feed lets you display a living, breathing record of people showing up for your cause.

🤝 Build instant trust: Overcome donor hesitation by showing a proven track record of community support.
💬 Highlight donor stories: Display real donor comments and locations to show the human side of your fundraising.
🛠️ Drop it anywhere: Easily add the block to your homepage, campaign pages, or confirmation screens in seconds.
📈 Curate your feed: Group multiple donations from the same person or sort by highest amounts to encourage larger gifts.

Campaigns New

🎨 Campaign Showcase: Pro Level Display, No Coding Needed.

Display your causes with style and make it easier than ever for donors to find the right campaign. We are excited to announce the brand-new Campaign Showcase, a powerful, no-code tool designed to help you create beautiful, high-converting campaign grids and carousels.

The Ultimate Discovery Experience

Your mission deserves to be seen. With the Campaign Showcase, you can move beyond simple lists and create dynamic displays that highlight your most urgent needs, helping donors connect with the causes they care about most.

⚡ No-Code Customization: Effortlessly change layouts, columns, and styles with a single click. Whether you want a clean grid or an interactive carousel, you can match your organization’s look without any CSS or JavaScript.

🎯 Advanced Search & Filter: Empower your supporters with real-time filtering. Donors can quickly sort through campaigns by tags, popularity, or “ending soon,” making it easy to find exactly where their help is needed.

💰 Quick Donate Integration: Boost your conversions with instant giving. The Showcase allows donors to contribute via a modal popup directly from the display, featuring pre-selected amounts for a faster, friction-free experience.

Addon New

🤯 New Addon: Campaign Updates

Keep your supporters informed and engaged with every step of your progress! Share the ongoing impact of your mission and build lasting trust with your donor community!

The Ultimate Engagement Tool

Fundraising is a journey, not a one-time event. Now, you can easily provide real-time updates directly on your campaign pages, ensuring your donors stay connected to the causes they care about most.

📣 Easy Storytelling: Quickly post text updates, milestones, or field reports to show exactly how donations are being put to work, keeping the momentum alive throughout your fundraiser.

🏗️ Visual Builder Integration: Seamlessly add the Updates block anywhere on your page using our drag-and-drop builder, or use a simple shortcode to display news in widgets and sidebars.

📩 Build Donor Trust: By consistently sharing progress and success stories, you create a transparent giving experience that encourages recurring support and deeper community involvement.