Charitable Documentation

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

Campaign Modal Donate Button

The Modal Donate Button (also referred to as Campaign Modal Button) lets you place a button that opens a donation form in a modal popup-or links directly to the campaign donation page-anywhere on your site. It is available as both a WordPress block and a shortcode, and is part of Charitable’s Universal Modal Donation System.

Table of Contents

Requirements

  • Charitable Pro: Version 1.8.13 or higher
  • WordPress: Version 6.2 or higher
  • PHP: Version 7.4 or higher

Getting Started

Block: Edit a page or post in the Block Editor → add block → search for Modal Donate Button or Charitable → insert the block → choose a campaign and configure the button in the sidebar.

Shortcode: Use [charitable_modal_button campaign_id="123"] in any post, page, or widget. Replace 123 with your campaign ID. You can add optional attributes for button text and CSS classes (see Shortcode).

Key Benefits

  • Place anywhere: Buttons in sidebars, footers, campaign grids (e.g. Campaign Showcase), or inline content.
  • Modal or link: Block lets you choose “Modal Popup” (donation form in a popup) or “Link to Donation Page” (normal link). Shortcode is modal-only.
  • No page reload: In modal mode, the form loads via AJAX and opens in an overlay; donors stay on the same page until they submit or close.
  • Campaign Selector control: When Campaign Selector is enabled globally, you can hide it for a specific button so the modal shows only the chosen campaign.

Block (Editor)

The block is registered as Modal Donate Button (charitable/modal-donate-button) under the Widgets category.

Block settings (sidebar)

Settings

  • Campaign – Required. Select the campaign this button will use for donations.
  • Button Text – Label on the button (default: “Donate Now”).
  • Button Action
    • Modal Popup – Click opens the donation form in a modal (default).
    • Link to Donation Page – Click goes to the campaign’s donation page.
  • Open in New Tab – Only when Button Action is “Link to Donation Page.” Opens the donation page in a new tab.
  • Hide Campaign Selector – Only when Button Action is “Modal Popup.” When enabled, the campaign selector dropdown is hidden in this modal even if it’s enabled in Charitable settings.

Colors

  • Background – Button background color.
  • Text – Button text color.
  • Border – Button border color.

Hover

  • Background – Button background on hover.
  • Text – Button text color on hover.

Size & Spacing

  • Button Width – e.g. auto100%200px.
  • Font Size – e.g. 16px1.2em.
  • Border Radius – e.g. 4px25px.
  • Horizontal Padding – e.g. 24px2em.
  • Vertical Padding – e.g. 12px1em.

Advanced

  • Custom CSS Class – Extra class(es) on the button element.
  • Modal CSS Class – Only when Button Action is “Modal Popup.” Extra class(es) on the modal container (default modal class is charitable-universal-modal).

The editor shows a preview of the button and the selected campaign name. On the frontend, the block outputs the same behavior as the shortcode (in modal mode) or a styled link (in link mode).

Shortcode

Shortcode name: charitable_modal_button

Required attribute

  • campaign_id – The campaign ID. The button will open the donation form for this campaign in a modal.

Optional attributes

AttributeDescriptionDefault
textButton label.“Donate Now”
classAdditional CSS class(es) for the button.
modal_classAdditional CSS class(es) for the modal container.

Examples

[charitable_modal_button campaign_id="42"]
[charitable_modal_button campaign_id="42" text="Give to this campaign"]
[charitable_modal_button campaign_id="42" class="my-donate-btn" modal_class="my-modal"]

Note: The shortcode always opens the donation form in a modal. To link to the donation page instead, use the block with Button Action set to “Link to Donation Page,” or use the standard donate link/shortcode (e.g. [charitable_donate_button] with the appropriate campaign and link behavior).

How the Modal Works

  1. Trigger: The button has the class charitable-modal-trigger and a data-campaign-id attribute. The Universal Modal script listens for clicks on this class.
  2. Load: On click, the script loads the donation form via AJAX for the given campaign and injects it into the modal overlay.
  3. Display: The modal opens (using the same overlay and structure as Charitable’s existing modals). Donors can complete the form or close the modal.
  4. Campaign Selector: If the Campaign Selector feature is enabled in Charitable settings and not overridden by the button (see below), the form can show a dropdown to switch campaigns. Individual buttons can force-hide it with the block’s “Hide Campaign Selector” option or by passing data-hide-campaign-selector when building the button in code.

The modal uses the Universal Modal Donation System (Charitable Pro 1.8.13+), so it works consistently whether the button is from the block, the shortcode, or from other features (e.g. quick-donate buttons in the Campaign Showcase block).

Campaign Selector in the Modal

  • Global setting: Charitable Settings → General → Donation Form → Campaign Selector. When enabled, donation forms can show a “Choose a Campaign” dropdown.
  • Per-button override (block only): In the Modal Donate Button block, when Button Action is “Modal Popup,” enable Hide Campaign Selector to hide that dropdown for this button’s modal. Useful when the button is for a single campaign and you don’t want the selector in the popup.
  • Shortcode: The shortcode does not expose a “hide campaign selector” attribute. To hide it for a shortcode button, you would need to add a custom CSS class and use JavaScript to set data-hide-campaign-selector on the trigger, or use the filter charitable_modal_donate_button_html to add the data attribute.

Troubleshooting

Button does nothing when clicked

  • Confirm the campaign ID is valid and the campaign is published.
  • Ensure the Universal Modal script is loaded (no script errors or aggressive removal of Charitable scripts on that page).
  • Check the browser console for JavaScript errors when clicking the button.

Modal doesn’t open or form doesn’t load

  • Verify you’re on Charitable Pro 1.8.13+ and that no plugin/theme is blocking charitable-universal-modal or the AJAX request that loads the form.
  • Test with a default theme and other plugins disabled to rule out conflicts.
  • Ensure the campaign can receive donations (e.g. not ended, not fully funded if that blocks donations).

Button looks wrong or styling is missing

  • Use the block’s ColorsSize & Spacing, and Advanced (custom class) options to adjust appearance.
  • For the shortcode, add a class and style that class in your theme or custom CSS. The trigger uses the class charitable-modal-trigger plus any classes you pass.

“Link to Donation Page” not available

  • That option exists only on the block. The shortcode [charitable_modal_button] is modal-only. For a simple link to the donation page, use the block with Button Action = “Link to Donation Page” or your theme’s/plugin’s donate link for that campaign.

Developer Resources

PHP

  • Template function: charitable_get_modal_donate_button( $campaign_id, $args ) – Returns the button HTML. Used by the shortcode and block.
  • Echo helper: charitable_modal_donate_button( $campaign_id, $args ) – Echoes the same HTML.

Arguments for charitable_get_modal_donate_button:

KeyTypeDefaultDescription
textstring“Donate Now”Button label.
classstringcharitable-modal-triggerCSS class(es) for the button.
modal_classstringcharitable-universal-modalCSS class for the modal container.
button_tagstringbuttonbutton or a.
stylestring''Inline style string for the button.
hide_campaign_selectorboolfalseWhen true, adds data-hide-campaign-selector="1"so the modal hides the campaign selector.

Filters

  • charitablemodaldonatebuttonshortcode_output – Filter the shortcode output. Parameters: $output$args.
  • charitablemodaldonatebuttonhtml – Filter the button HTML from charitable_get_modal_donate_button. Parameters: $button_html$campaign_id$args.

CSS / HTML

  • Button: The trigger has class charitable-modal-trigger and attributes data-campaign-id, optionally data-modal-classdata-hide-campaign-selector.
  • Block wrapper: .wp-block-charitable-modal-donate-button.
  • Modal: The overlay and modal container are created by the Universal Modal script; the modal uses the class you pass (e.g. charitable-universal-modal).

Version history

VersionChanges
1.8.13Modal Donate Button block and shortcode; Universal Modal Donation System; block supports Modal Popup vs Link, styling, Hide Campaign Selector; charitable_get_modal_donate_button gains style and hide_campaign_selector.

For global donation form and Campaign Selector settings, see Campaign Selector. For embedding full donation forms (not in a modal), see the donation form and campaign shortcode documentation.

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!

automation update

⚡ Visual Automation Builder: Drag and Drop With No Code!

Charitable Automation Connect 2.3.0 introduces the Visual Automation Builder, a full-screen canvas that lays each automation out as a flow of connected cards: a trigger, optional conditions, and a list of actions that run in order.

🧩 Many actions, one trigger: Tag a donor, send an email, add a note, and fire a webhook from a single event, dragged into any order.

✉️ Act inside Charitable: New Send Email, Tag Donor, and Add Donor Note actions run with no external service required.

🔤 Merge tags: Personalize emails and notes with live fields like {first_name}, {total}, and {campaign_name}.

🔁 Apply to existing donors: Run Tag Donor and Add Donor Note against the donors you already have.

🖥️ Canvas or Simple: Switch views anytime, and automations built before 2.3.0 keep working unchanged.

Read more here.

Integration updated

📬 Introducing Brevo for Charitable: Turn Donors into Subscribers Automatically

The moment a supporter makes a gift is when they are most engaged. With the new Brevo integration for Charitable, you can automatically turn those one-time donors into long-term subscribers without touching a single spreadsheet.

Simply collect donor consent right on your donation form and start your welcome series immediately.

What’s New:

🔄 Automated Subscriber Sync: New donors who opt in are added straight to your Brevo contact list as soon as their payment clears—no manual exports or CSV imports required.

🎯 Granular Consent & Opt-In Control: Customize your checkbox label, choose whether it defaults to checked or unchecked, or turn on Brevo double opt-in to keep your list clean and compliant.

📋 Per-Campaign List Mapping: Route supporters to your global email list or map specific campaigns to targeted Brevo lists to tailor your follow-up messaging.

⚡ 5-Minute Setup: Connect instantly by pasting your Brevo API key into the Newsletter settings, map your contact fields, and start building your email list on autopilot.

Ready to grow your mailing list? Brevo is available now starting on the Charitable Plus plan—connect your account today!

recurring donations updated

💳 Introducing Card Updates: Fix Expired Cards Without Losing Subscriptions!

newExpired or updated credit cards are one of the biggest silent leaks in recurring fundraising. With Card Updates in the Recurring Donations extension, donors can now refresh their payment details directly—keeping their subscription, schedule, and giving history completely intact.

No canceled plans, no lost history, and zero administrative headache for your team.

What’s New:

⚡ 30-Second Self-Service: Donors get a dedicated “Update Card” button in their dashboard that opens Stripe’s secure, PCI-compliant Customer Portal to update card details instantly.

🔒 Scoped & Safe Access: Scoped exclusively to card updates by default, donors can’t accidentally cancel or alter their plans from inside the portal, keeping your webhooks and data in sync.

🤝 Admin-Assisted Support: Helping a donor on the phone? Open their secure Stripe portal in one click from your admin screen or generate a single-use update link to email them.

📋 Automatic Audit Trail: Every payment method update is recorded automatically with a timestamp in both system-wide logs and the individual donor’s profile.

Ready to protect your recurring revenue? Get the Plus or Pro plan and update Recurring Donations to 2.3.0+ and enable “Update Payment Method” under your Settings today!

Integration page builder

Divi Fans Rejoice! Native Divi 5 Campaign Progress Bar Module!

With our new native Divi 5 module, you can anchor your microsites with real-time fundraising stats directly on the visual canvas. Here’s how it works, and why it’s worth turning on today.

Create campaign updates that are VISUAL AND LIVE. You can also:

📊 Campaign Progress Bar: Drop a live progress bar into any Divi 5 layout and show goal progress in real time.

🎨 Deep styling controls: Easily customize the bar and track color, height, and radius to match your brand perfectly.

👁️ Visual Builder ready: Configure and preview everything directly on the Divi canvas as a first-class module.

🔁 Identical rendering: The same exact engine powers this module, meaning consistent design without legacy shims.

✅ Faster launches: Never leave the Divi 5 interface to configure shortcodes or guess how your goal labels will look.

Learn more here.

Integration page builder

👉🏻 New in Charitable: Native Elementor Widgets for Seamless Campaign Building

With native Elementor widgets, you design donation campaigns right alongside the rest of your page without touching code. Here’s how it works, and why it’s worth turning on today.

Create fundraising pages that are VISUAL, NATIVE, AND SHORTCODE-FREE. You can also:

⚡ Mini Donation: Add a compact, high-converting donation widget with preset amounts and full color control.

⏳ Campaign Countdown: Build urgency for a deadline-driven appeal, complete with optional confetti when the goal is hit.

📣 Donation Feed: Prove momentum by showing visitors the social proof of real people giving right now.

🏆 Donor Leaderboard: Celebrate top supporters with gold, silver, and bronze styling to spark friendly giving.

🖼️ Campaign Showcase: Feature multiple campaigns in a landing page grid or carousel, with search, filters, and badges.

Learn more here.