Charitable Documentation

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

How to Use the Embed Widget to Allow Ambassadors to Show Fundraisers On Any Website

Requires: Charitable Pro 1.8.16+
Charitable Ambassadors 3.0.0+

Your ambassadors don’t fundraise in a vacuum. They write blog posts, share stories on partner sites, and build landing pages on platforms that have nothing to do with your WordPress install. The Embed Widget gives them a way to bring their fundraiser into all of those places.

The Embed Widget lets your ambassadors paste a small HTML snippet on any external site: a blog post, a landing page, a partner site, and a Medium article. It renders their fundraiser’s live progress bar and donate button with no iframe, no install, and no JavaScript framework required. The widget pulls live data from your site’s REST API and stays in sync as donations come in.

It turns “share this link” into “embed this widget,” which means your fundraiser shows up in the actual context where people are reading, instead of asking them to click off to a separate site.

When You’d Use It

The Embed Widget opens up a lot of doors for ambassadors who are actively promoting their fundraiser beyond your site. Here are the most common situations:

  • Ambassador blog posts: your ambassador writes about their fundraiser on their personal blog. Drop the widget in the post, and readers can donate without leaving the page.
  • Partner and media sites: a local news site covers your event. They embed the widget so readers can donate in-line while they’re reading the story.
  • Landing pages on other platforms: your marketing team builds a landing page on Webflow, Framer, or Squarespace. Paste the snippet, and you get a live widget with no plugin required.
  • Internal dashboards: leadership wants a real-time view of the gala fundraiser on the company intranet. Embed it, and it updates automatically.

How to Get There

Go to Charitable » Ambassadors » Misc » Embed Widget. The widget is off by default.

Turn on Enable Embed Widget, configure the defaults, and the Embed Widget tile will appear in the share popover on every fundraiser page.

The Settings

SettingDefaultEffect
Enable Embed WidgetOffMaster switch. Until it’s on, the Embed Widget tile is hidden from every share popover.
Default Snippet SizeCompact (320×500)Which size the modal offers first. Compact works well in sidebars and narrow columns. Wide (600×320) suits full-width hero blocks.
Default Snippet ThemeLightLight or Dark. Ambassadors can override this per-embed inside the modal.
CORS Allowed Origins* (all origins)One origin per line, or * to allow any. The REST endpoint enforces this header.

The defaults are what the snippet builder starts with. Ambassadors can flip the size or theme inside the modal before copying, so these are starting points rather than hard limits.

The User Flow

From any fundraiser page, a visitor or the ambassador themselves clicks the Share button and picks Embed Widget. The modal that opens has three sections:

  1. Live preview: a real-time render of what the widget will look like at the chosen size and theme.
  2. Size and theme toggles: flip between Compact and Wide, or Light and Dark.
  3. Snippet: a copyable textarea with the exact HTML. One Copy Snippet button and it’s ready to paste.

The snippet looks something like this:

<div class="charitable-embed-widget"
     data-fundraiser-id="123"
     data-size="compact"
     data-theme="light"></div>
<script src="https://yoursite.com/wp-content/plugins/charitable-ambassadors/assets/js/charitable-ambassadors-embed-widget.js"
        async></script>

Paste that anywhere that allows <script> tags: a WordPress post, a Medium article, a Webflow embed block. The widget renders at page load and polls for updates automatically.

What Renders on the Destination Site

The widget shows everything a visitor needs to understand and support the fundraiser, without leaving the page they’re on:

  • Featured image (small thumbnail at the top in Compact, left-aligned hero in Wide).
  • Title and ambassador name.
  • Current raised amount and goal with a progress bar.
  • Donor count.
  • A Donate button that opens the fundraiser page in a new tab, so the actual donation flow uses your live form rather than a mini form inside the widget.

Live updates happen every 30 seconds via the REST endpoint, so the numbers stay accurate as donations come in.

CORS Configuration

Because the widget loads on third-party sites, the REST endpoint needs CORS headers. The default * allows any origin, which is convenient for getting started. If your security policy requires an explicit allowlist, replace * with one origin per line:

https://partner.example.com
https://blog.yoursite.com
https://medium.com

The endpoint emits an Access-Control-Allow-Origin header matching the request’s Origin when it finds a match in the list.

When the Widget Can’t Render

Three situations can prevent the widget from displaying. In each case the fallback is designed so the host page is never broken by a bad embed.

StateWhat renders
Fundraiser doesn’t existA “Fundraiser unavailable” placeholder. The browser console logs an error with the fundraiser ID.
Fundraiser is unpublished“Fundraiser unavailable” – same as above. The public visibility check matches the public fundraiser page.
CORS deniedThe widget container stays empty. The browser console shows the CORS error. The host page itself is unaffected.

Tips Worth Keeping in Mind

A few things that make the Embed Widget work better in practice.

  • Use Wide for hero sections, Compact for sidebars. Wide is 600×320 and works well in a featured-content slot. Compact is 320×500 and fits naturally in a vertical sidebar or narrow column.
  • Match the theme to the host site. Dark embeds look great on darker blogs and Medium’s night mode. Light works on most marketing and editorial sites.
  • Lock down CORS before a security audit. The default * accepts embeds from any origin. If that matters to your program, add an explicit allowlist before you go to production.
  • The snippet lives forever once it’s pasted. When an ambassador copies the snippet onto an external site, that site keeps fetching live data from your REST API indefinitely. If you ever need to retire an embed, unpublish the fundraiser.

Developer Reference

The rest of this page is for developers customizing the embed widget.

Settings Storage

charitable_settings > ambassadors > embed_widget_enabled
charitable_settings > ambassadors > embed_widget_default_size       # 'compact' | 'wide'
charitable_settings > ambassadors > embed_widget_default_theme      # 'light' | 'dark'
charitable_settings > ambassadors > embed_widget_cors_origins       # newline-separated or '*'

REST Endpoint

GET /wp-json/charitable-ambassadors/v1/embed-widget/<fundraiser_id>

Returns JSON:

{
    "id": 123,
    "title": "Sarah's Marathon Run",
    "permalink": "https://yoursite.com/fundraisers/sarahs-marathon-run/",
    "image_url": "https://yoursite.com/wp-content/uploads/2026/05/hero.jpg",
    "raised": 12450,
    "goal": 50000,
    "donor_count": 87,
    "ambassador_name": "Sarah Chen",
    "currency": "USD"
}

Capabilities: public, no auth required, since the widget needs to load on external sites. CORS is controlled by the charitable_ambassadors_embed_widget_cors_origins filter, which defaults to reading the CORS Allowed Origins setting.

Classes

ClassFileRole
Charitable_Ambassadors_Embed_Widget_Restincludes/embed-widget/class-charitable-ambassadors-embed-widget-rest.phpREST route registration and CORS handler.
Charitable_Ambassadors_Embed_Widget_Rendererincludes/embed-widget/class-charitable-ambassadors-embed-widget-renderer.phpServer-side render and the modal HTML.

Filters

FilterDefaultPurpose
charitable_ambassadors_embed_widget_enabledsetting valueForce the feature on or off.
charitable_ambassadors_embed_widget_cors_originssetting value as arrayThe list of allowed origins for the REST endpoint. Use [ '*' ] for any.
charitable_ambassadors_embed_widget_default_sizesetting valueOverride the default size.
charitable_ambassadors_embed_widget_default_themesetting valueOverride the default theme.
charitable_ambassadors_embed_widget_responsecomputedFilter the REST response payload. Receives ($payload, $fundraiser_id).
charitable_ambassadors_embed_widget_docs_urlthis pageOverride the docs URL the “How to embed” link points at.

Actions

ActionArgsFires when
charitable_ambassadors_embed_widget_rendered$fundraiser_id, $size, $themeServer-side render completes.

JS API

The widget script exposes a small global you can call from the host page’s JS to force a data refresh outside the normal polling interval:

window.charitableEmbedWidget.refresh( containerEl );

Capabilities

REST endpoint: public read. Admin settings require manage_charitable_settings.

Customization Examples

Restrict CORS to two trusted origins:

add_filter( 'charitable_ambassadors_embed_widget_cors_origins', function () {
    return [ 'https://partner.example.com', 'https://blog.yoursite.com' ];
} );

Always force the Dark theme regardless of the ambassador’s choice:

add_filter( 'charitable_ambassadors_embed_widget_default_theme', function () {
    return 'dark';
} );

Add a custom field to the REST response (for example, the ambassador’s bio):

add_filter( 'charitable_ambassadors_embed_widget_response', function ( $payload, $fundraiser_id ) {
    $author_id = (int) get_post_field( 'post_author', $fundraiser_id );
    $payload['ambassador_bio'] = get_user_meta( $author_id, 'description', true );
    return $payload;
}, 10, 2 );

Hide the Embed Widget tile from the share popover for specific user roles:

add_filter( 'charitable_ambassadors_embed_widget_enabled', function ( $enabled ) {
    if ( ! current_user_can( 'edit_posts' ) ) {
        return false;
    }
    return $enabled;
} );

Wrapping Up

That covers the Embed Widget from setup to customization. Once you turn it on, your ambassadors can promote their fundraisers anywhere on the web and keep the donation experience live and current without any extra work on your end. Enable it, set your CORS policy, and let your ambassadors do the rest.

If you run into questions about CORS configuration or anything else, our support team is happy to help.

You May Also Want to Read

These are the docs most closely connected to the Embed Widget and the features it works alongside.

  • Sharing Networks – the share popover where the Embed Widget tile lives alongside the social network buttons.
  • QR Codes – another share popover tile that gives ambassadors a different way to share their fundraiser.
  • Fundraiser Page – the page the Donate button on the widget links back to.
  • Hooks & filters in Ambassadors – the full developer reference.

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.