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!

Improvement Migrations

↔️ Importing From GiveWP, Donorbox, GiveButter… even CSV!

Whether you’re migrating from another platform or consolidating your records, moving your data to Charitable is now faster and more flexible than ever. We’ve streamlined the process so you can bring over your entire fundraising history in just a few clicks.

🔄 Native GiveWP, Donorbox, & GiveButter Support: Switching from a major platform? Our dedicated migration tools handle the heavy lifting, automatically mapping your donors and donations directly into Charitable—no technical skills required.

📂 Universal CSV Import: Moving from a custom system or a specialized CRM? If you can export it to a CSV, you can import it here. Our smart mapping tool lets you align your columns to Charitable fields like names, emails, phone numbers, and addresses in seconds.

Instant Donor Profiles & Custom Tags: Automatically create rich donor profiles and bring in custom tags to keep your data organized. Segment and engage your supporters from day one with a clean, professional database structure.


Ready to make the switch?

Check out our GiveWP Migration Guide

Learn more about our Import Tools

Improvement Payments

💳 New Braintree Features For Your European Donors

With the release of Braintree addon version 1.3.0, you can now empower your European donors with the payment methods they trust and prefer, making giving seamless for international supporters.

🌍 Six New European Payment Methods: Support popular local options like iDEAL (Netherlands), Bancontact (Belgium), BLIK (Poland), and more to meet donors where they are.

⚡ Frictionless Donor Experience: These bank-based methods allow donors to authenticate directly with their own bank in a secure popup… no credit card numbers required.

⚙️ Automatic Currency Sync: No complex setup needed. The builder automatically displays the correct payment buttons based on your site’s currency (EUR or PLN), ensuring a relevant experience for every visitor.

Campaigns New

🖼️ Campaign Featured Images: Pro-Level Visuals Made Simple

With the new Campaign Featured Image setting in our visual builder, you now have a single, dedicated place to manage how your fundraisers look across your entire site and beyond.

🖼️ One Image, Everywhere: Set a primary thumbnail that automatically syncs to campaign grids, lists, and shortcodes—no more relying on layout order.

📱 Social Sharing Optimized: Easily upload images at the perfect size to ensure your campaigns look stunning and professional when shared on social media.

🔍 SEO & Accessibility Ready: Add custom alt text directly within the builder to improve search rankings and ensure your mission is accessible to every supporter.

Improvement receipts

🗓️ Annual Receipts 2.0: Send Year-End Receipts to Every Donor in Minutes

You can now send annual receipts in minutes with a few clicks to all your donors.

📧 One-Click Bulk Send Wizard that guides you to sending to hundreds of donors simultaneously directly from your WordPress dashboard.

🔍 Smart “Dry Run” Mode: See exactly who will receive a receipt and who will be skipped (and why) before a single email leaves your server.

🛡️ SMTP-Aware & Limit Protection: Charitable now detects your email setup and automatically adjusts batch sizes and pauses for daily limits to ensure your emails land in inboxes.

✅ Complete Audit Trail: Dedicated system log and on the individual donor’s profile, giving you a clear history for every fiscal year.

Stop dreading tax season and start spending that time on your mission. Update to Annual Receipts 2.0 and automate your year-end reporting today.

Addon Donations Improvement

🎈Recurring Donations 2.0: Smarter Automation, Better Recovery, and More Control

We’ve completely rebuilt our Recurring Donations system to help you grow your reliable income stream while giving you (and your donors) more powerful tools than ever before.

What’s New:

🔒 Recurring-Only Campaigns: You can toggle “Recurring Only” mode in the campaign builder to hide the one-time option entirely, ensuring your supporters stay focused on long-term commitment.

📧 Automatic Payment Recovery: Our new Payment Failed Email fires automatically the moment a subscription fails.

🛠️ Self-Service Donor Control:The new Cancel Subscription Button appears directly in the donor dashboard, allowing supporters to pause or end their recurring gifts on their own terms—reducing your admin burden and payment disputes.

📊 Real-Time Revenue Insights: Track your growth, monitor active subscriptions, and see exactly how much predictable support is coming in each month at a glance.

Our new Recurring Donations addon gives you the professional-grade tools you need to grow your mission.