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!

Improvement Payments

💸 Introducing Tiered Rates for Fee Relief: Match the Ask to the Gift!

Fee Relief asks your donors one short question at checkout: would you like to cover the processing fee on this gift? Until now that question used a single rate for every donation on a gateway, so a $10 gift and a $500 gift were asked for the same percentage. Fee Relief 1.3.0 lets you set as many donation bands as you like, each carrying its own rate. Why this is important:

  • 🪙 Gentler on small gifts: A fixed transaction cost is a far bigger share of a $10 donation than a $500 one, so bands let you ask for less at the bottom.
  • 🎚️ As many bands as you need: Each band carries its own percentage and its own fixed amount, and the top band runs on with no upper limit.
  • 🛑 An optional ceiling: A Maximum fee field stops any donor being asked for more than a number you choose, however large the gift.
  • 🔌 Set per payment gateway: Stripe can run on four bands while Windcave and Payfast stay on a single rate, because bands belong to a gateway and not to your whole site.
  • 🛡️ Nothing changes until you say so: Your current rates stay exactly as they are until you switch Use Tiered Rates on under Charitable » Settings » Advanced » Fee Relief.

Check out our announcement here.

Donations Improvement

📊 Your Pro Dashboard Can Now Compare, Export, and Score!

Most fundraising dashboards only tell you how much you have raised. Charitable Pro 1.8.19 rebuilds the dashboard and the Reports Overview around the harder questions: whether anything is broken, whether this period beat the last one, and which single change would make the most difference today. Why this is important:

  • 📈 Every figure has a trend: Pick a period and the tiles and the chart move together, with each total shown against the previous period.
  • 🗓️ Charts that stay readable: Short ranges group donations day by day, while longer ranges group by week or month, so a full year reads as a curve instead of a flat line.
  • 🔀 Compare any 2 periods: Not just consecutive ones, so you can ask how this December did against last December. That matters because fundraising is seasonal.
  • 📤 Export the whole summary: Send the full overview out as CSV or PDF, ready for a board pack or a funder report.
  • 🎯 Score your setup for free: Have your fundraising setup scored, so the one change worth making next is the one you can see.

Check out our announcement here.

Feature New

🎟️ Introducing Charitable Events: Sell Tickets Inside Your Campaigns!

Most nonprofits sell event tickets in one tool and collect donations in another, which leaves two sets of reports and a manual match at the end of the year. Charitable Events brings both together, selling tickets through the same donation forms and payment gateways you already run in Charitable. Why this is important:

  • 🎟️ Every ticket is a donation: Ticket sales run through the gateway you already use and count toward the campaign goal, with everything managed under Charitable » Events.
  • 📱 QR check-in from any phone: Each attendee gets their own QR code on the receipt, and volunteers scan at the door through a check-in link that needs no WordPress account.
  • 🧾 Receipts ready for tax time: Give each ticket type a fair market value, and Charitable puts the correct tax-deductible amount on every donor receipt.
  • 📋 Attendee details at checkout: Ask every guest for a meal choice, shirt size, or access needs, with a separate attendee record created for each ticket.
  • 🗓️ Blocks and calendars included: Three editor blocks plus Sugar Calendar and The Events Calendar support put your events where supporters already look.

Check out our announcement here.

ai New

🚀 Unleash AI Power in Charitable!

Your AI assistant can now build, edit, and manage your Charitable fundraising campaigns directly — just by asking. With Charitable Pro adding write support for the WordPress Abilities API, tools like ChatGPT, Claude, and Cursor can handle full administrative actions safely through MCP. Why this is important:

  • 🤖 Campaign creation in plain language: Prompt your assistant with a goal like “Set up a fundraiser for the shelter with a $5,000 goal”, and it builds a real draft campaign complete with suggested donation tiers.
  • 🎨 Instant donation form tweaks: Add custom fields, change button colors, or reorder elements without diving into form settings.
  • 📝 Offline gift logging: Tell your assistant about cash or check gifts, and it will match donor emails and record transactions into your history.
  • 🛡️ Safety and control by default: Write access stays strictly off until turned on in Charitable » Tools » AI MCP, keeping read-only reporting safe by default.
  • 📜 Full audit logging: Every change made by an AI assistant is tracked under Charitable » Tools » Logs, so you always know who (or what) updated your site.

Check out our announcement here.

Improvement Payments

💰 Accept Recurring Donations with Windcave and Charitable

A donor sets their gift up once on Windcave’s secure payment page, and Charitable bills every renewal after that on schedule. Why this is important:

🏦 Organizations banked in New Zealand or Australia: monthly giving on the gateway your bank already set you up with, with no second processor to onboard.
⛪ Churches taking regular tithes and offerings: congregants set their own schedule once, which is the simplest way to launch recurring church giving without a separate platform.
🌏 Groups with donors in several currencies: Windcave handles more than 20, so a supporter can give in the currency they actually hold.
📅 Operating funds rather than one-time campaigns: switch on Recurring Only mode and the one-off option disappears, so every gift to that campaign is a subscription.
🧾 Teams with no developer on staff: 3 sets of credentials pasted into a settings page, and no code anywhere.

Check out our announcement here.