Charitable Documentation

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

Charitable_User

The Charitable_User class allows you to get access to information about a particular user.

Charitable_User is a sub-class of WP_User.

Getting an instance of Charitable_User

Given a user ID, you can retrieve a Charitable_User instance in one of two ways:

$user_id = 123;

// Get instance from cache
$user = charitable_get_user( $user_id );

// Direct instantiation
$user = new Charitable_User( $user_id );

The advantage of using charitable_get_user is that it uses the object cache to retain the instance of Charitable_User.

Properties

Charitable_User has access to all the same properties as WP_User:

https://codex.wordpress.org/Class_Reference/WP_User

Methods

get_donor_id()

Returns the donor ID for this user. If this user has never donated, this will return false.

get_donor()

This returns a single record from the wp_charitable_donor table for the donor.

is_donor()

This returns whether the user is a donor.

is_verified()

This returns whether the user has verified their email address.

mark_as_verified( $verified )

This sets whether the user’s account is verified.

Params
$verified
Boolean. Whether the user’s account is verified.

get_email()

Returns the user’s email address.

get_name()

Returns the user’s full name. Note that if the user has not supplied a first name, only the last name will be returned; and vice versa.

get_first_name()

Returns the user’s first name.

get_last_name()

Returns the user’s last name.

get_location()

Returns the user’s location.

If available, this will show the user’s city, followed by their country; if a city is not set, it will show the user’s state, followed by their country. If neither a city nor state is shown, this will return the user’s country.

If no country is set, just the city or state will be shown.

get_address( $donation_id = '' )

Returns the printable address of the user. If a donation id is specified, this will return the address used for the donation.

Params
$donation_id
Optional. If set, this will return the address for the donation. Otherwise, this will return the address stored in the donor’s profile.

get_donations( $distinct_donations = false)

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

Params
$distinct_donations
Boolean. If true, this will only show unique donations.

count_donations( $distinct_donations = false)

This returns the number of donations made by the donor.

Params
$distinct_donations
Boolean. If true, this will only count unique donations.

count_campaigns_supported()

This returns the number of campaigns to which the user has donated.

get_total_donated( $campaign_id = false )

Returns the total amount donated by the user, or the total donated to a particular campaign by the user.

Params:
$campaign_id
Optional. If set, this will only get the total amount donated by the donor to the given campaign. By default, this is set to false.

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.

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_avatar_src( $size = 100 )

Returns the image source file of the 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_campaigns( $args = array() )

Returns a WP_Query object with all campaigns created by the donor.

Params
$args
Optional. Additional arguments to be passed to WP_Query.

get_current_campaigns( $args = array() )

Returns a WP_Query object with all campaigns created by the donor that are currently active.

Params
$args
Optional. Additional arguments to be passed to WP_Query.

has_current_campaigns()

Returns whether the donor has any current campaigns.

get_activity( $args = array() )

Returns a WP_Query object with all donations and campaigns created by the donor, ordered by date.

Params
$args
Optional. Additional arguments to be passed to WP_Query.

Still have questions? We’re here to help!

Last Modified:

What's New In Charitable

🔔 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!

Integration New

WordPress Command Palette Integration

Take your fundraising workflow to the next level. Speed up your site management and stay in your creative flow with our new WordPress Command Palette integration.

Supercharge Your Workflow
Navigate your fundraising dashboard faster than ever.

The Ultimate Keyboard Shortcut Hit Cmd + K (or Ctrl + K) to launch the Command Palette and manage your campaigns instantly.

⚡ Instant Navigation: Jump directly to your Campaigns, Donations, or Settings from anywhere in the editor.

➕ Quick Create: Start a new fundraising campaign or add a manual donation with a single command.

Efficiency Redefined
The tools you need, exactly when you need them.

⚙️ Contextual Actions: See relevant Charitable commands based on whether you’re editing a page or viewing your reports.

🚀 Seamless Integration: Built directly into the WordPress core experience for a lightweight, native feel.

Improvement New Security

📣 New Security Features

We’ve introduced a suite of new security tools to give you total control over who accesses your forms, plus a new way to tidy up your database.

Advanced Security Suite

Layered protection: Cloudflare, ReCAPTCHA, IP Controls, and Rate Limiting.

We have overhauled our security settings to stop bots without blocking real donors.

  • 🤖 Flexible Protection: Choose between Google reCAPTCHA v3 or the privacy-first Cloudflare Turnstile to block bots invisible.

  • 🚦 Rate limiting: Stop spam floods by limiting how many submissions an IP address can make in a set timeframe.

  • 🛑 Total control: Use the new IP Blacklist to block bad actors instantly, or the IP Whitelist to let your team bypass checks during testing.

The Clean Donation Tool

Go from “Testing” to “Live” in seconds.

Finished setting up your site and need to get rid of all those test transactions?

  • 🧹 Sweep it clean: Bulk delete test donations and donor records with a single click.

  • 📉 Accurate reporting: Ensure your revenue stats are 100% accurate for launch day.

  • ⚙️ Reset sequences: Automatically resets sequential invoice numbering.

donation form New

🏗️ Visual Donation Form Builder

Building the perfect donation form just got easier. We have completely reimagined how you create forms with a new drag-and-drop interface.

Design Visually, in Real-Time

No coding, no guessing. Just point, click, and build.

Say goodbye to confusing settings pages. You can now edit your form and see exactly what your donors will see, instantly.

  • 🖱️ Drag & Drop: Easily add fields like names, addresses, or file uploads by dragging them exactly where you want them.

  • 🎨 Customize everything: Click any field to tweak labels, placeholders, and requirement settings on the fly.

  • 👁️ Live preview: See your changes immediately as you make them—ensure your form flows perfectly before you hit publish.

Flexible & Powerful

Works with all your existing campaigns.

  • 🧩 Deep customization: Add custom HTML, shortcodes, or CSS classes for advanced branding.

  • ⚙️ Smart fields: Collect exactly what you need with support for dropdowns, checkboxes, dates, and hidden fields.

Leaderboards New

🏆 Donor Leaderboards!

Turn your fundraising into a community event. Recognize your most generous supporters and inspire friendly competition with our new leaderboard tools.

Gamify Your Fundraising

Celebrate your top donors and encourage others to climb the ranks.

Create a public “Hall of Fame” to give your donors the recognition they deserve.

  • 🎨 Two stunning layouts: Choose the List View for a clean, data-rich table or the Card View for a modern, visual grid with avatars.

  • 🥇 Automatic highlights: The top 3 supporters get special Trophy and Crown icons to make them stand out.

  • 🧩 Place it anywhere: Add it to any page using the new Gutenberg Block, or drop it directly into your campaign using the Visual Builder.

Total Customization

You decide what to show and what to hide.

  • ⚙️ Flexible data: Choose to display or hide donation amounts, donor counts, or avatars.

  • 🔄 Lifetime stats: Works seamlessly with Recurring Donations to show a donor’s all-time total impact.

Improvement New templates

🎨 New Templates & List Builder

Launch faster and design better. We’ve added three professional campaign templates and a versatile new content block to help you tell your story.

3 New Campaign Templates

Ready-to-use designs for specific fundraising needs.

Don’t start from scratch. Pick a template tailored to your cause and launch in minutes.

  • 🎄 Holiday Fundraiser: A warm, festive design perfect for year-end giving, toy drives, or food pantries.

  • 🎓 School Fundraiser: Built for PTAs and sports teams. clearly highlights goals like playground upgrades or classroom tech.

  • Church Fundraiser: A trustworthy layout designed for building funds, mission trips, and tithes.

The New “List” Block

Organize your campaign details without writing code.

Make your campaign pages easier to scan and more visually engaging with our new builder block.

  • 📝 Flexible layouts: Choose from 3 distinct styles to display sponsorship levels, donation perks, or project goals.

  • 🎨 Rich customization: Add colorful headlines, support for emojis, and unlimited list items.

  • 👣 Smart footers: Include a built-in footer for extra context or a final Call to Action.