Charitable Documentation

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

Hooks and filters in Ambassadors

Please note: This documentation is a work in progress and does not yet cover all filters & action hooks available in Charitable Ambassadors. If you do not see a hook or filter describing what you need to do, please get in touch via our support page and we can help you.

Filters

charitable_ambassadors_fundraiser_title

Added in version 2.0.0

Change the automatically generated title for a new fundraiser, when the title is set to be dynamically based on the campaign creator’s name.

Return Value

String. The title of the fundraiser.

Arguments

  • $title (string)

    The title. By default this will be the campaign creator’s full name.

  • $data (array)

    The submitted data.

Usage

add_filter( 'charitable_ambassadors_fundraiser_title', function( $title, $data ) {
    $first_name = array_key_exists( 'first_name', $data ) ? $data['first_name'] : '';
    $last_name  = array_key_exists( 'last_name', $data ) ? $data['last_name'] : '';
    $full_name   = trim( sprintf( '%s %s', $first_name, $last_name ) );

    // Joe Blow's Fundraiser
    return sprintf( "%s's Fundraiser", $full_name );
}, 10, 2 );

Added in version 2.0.0

Choose whether you want to show the “Create a New Campaign” button at the bottom of the output of the [charitable_my_campaigns] shortcode.

Return Value

Boolean. True if you do want to show it, or false if you would prefer not to. This will return true by default.

Arguments

  • $show (boolean)

    Whether to show the button.

Usage

// Do not show the button.
add_filter( 'charitable_ambassadors_my_campaigns_show_campaign_creation_link', '__return_false' );

charitable_ambassadors_my_campaigns_button_text

Added in version 1.0.0

Change the text of the “Create a Campaign” button at the bottom of the [charitable_my_campaigns] shortcode.

Return Value

String. The text to use in the button.

Arguments

  • $text (string)

    The button text.

Usage

add_filter( 'charitable_ambassadors_my_campaigns_button_text', function( $text ) {
    return 'Start a New Campaign';
} );

Added in version 1.0.0

Change the page that users will be redirected to after they submit their campaign for the first time. Note that if you want to redirect to a static page, you can do this without code by configuring the “Campaign Submission Success Page” setting under Charitable > Settings > Ambassadors.

Return Value

String. A URL to redirect to after first submitting a campaign. Note that the redirect is done through a call to wp_safe_redirect(), so the URL should be to an allowed host (see https://developer.wordpress.org/reference/functions/wp_safe_redirect/).

Arguments

  • $default (string)

    The URL to redirect to.

  • $args (array)

    An array of arguments. By default, this will only have a campaign_id property with the ID of the newly submitted campaign.

Usage

// Redirect to the newly submitted campaign after submission.
add_filter( 'charitable_permalink_campaign_submission_success_page', function( $url, $args = array() ) {
    if ( ! array_key_exists( 'campaign_id', $args ) ) {
        return $url;
    }

    return get_permalink( $args['campaign_id'] );
}, 10, 2 );

charitable_campaign_submission_redirect_url

Added in version 1.0.0

Change the URL that users are redirected to after they submit, update or save & preview their campaign.

If you only want to change the page that users are redirected to after they first submit their campaign, use the charitable_permalink_campaign_submission_success_page filter instead.

Return Value

String. The URL that the user will be redirected to.

Arguments

  • $url (string)

    The URL that the user will be redirected to.

  • $data (array)

    The submitted data.

  • $campaign_id (int)

    The campaign ID.

  • $user_id (int)

    The user ID.

charitable_ambassadors_fundraiser_form_field_list

Added in version 2.1.0

Add or remove fields to the fundraiser form.

The fields list is a list of keys of fields that are included in the main campaign form, which should also be included in the fundraiser form. The following fields are not included in the fundraiser form by default:

description
categories
tags
suggested_donations
allow_custom_donations

Return Value

array

Arguments

  • $list (array)

    The list of fields to be included.

  • $form (Charitable_Ambassadors_Fundraiser_Form)

    The fundraiser form object.

Usage

// Include the 'description' field in the Fundraiser form.
add_filter( 'charitable_ambassadors_fundraiser_form_field_list', function( $fields ) {
    $fields[] = 'description';
    return $fields;
} );

charitable_ambassadors_fundraiser_inherited_fields

Added in version 2.0.0

Filter the fields that are automatically inherited from the fundraiser’s parent campaign.

Return Value

array

Arguments

  • $fields (array)

    The inherited fields.

Usage

add_filter(
    'charitable_ambassadors_fundraiser_inherited_fields', 
    function( $fields ) {
        $fields[] = 'my_custom_field';
        return $fields;
    }
);

charitable_ambassadors_update_fundraiser_end_dates_on_parent_end_date_change

Added in version 2.0.0

Set whether end dates of fundraisers should be updated automatically when a parent campaign has its end date changed.

Return Value

Boolean. Defaults to true.

Arguments

  • $should_update (boolean)

    Whether to update automatically.

  • $campaign (Charitable_Campaign)

    The parent campaign object.

charitable_ambassadors_creator_donations_export_columns

Added in version 2.0.0

Filter the columns that are included in the export.

Return Value

Array. The keys of columns to include.

Arguments

  • $columns (array)

    The columns to include.

Usage

add_filter( 'charitable_ambassadors_creator_donations_export_columns', function( $columns ) {
    // Only show the first name, last name, amount and donor comment.
    $included_columns = array(
        'first_name',
        'last_name',
        'amount',
        'donor_comment',
    );
	
    foreach ( $columns as $column => $header ) {
        if ( ! in_array( $column, $included_columns ) ) {
            unset( $columns[ $column ] );
        }
    }
	
    return $columns;
} );

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!

Addon New

🤯 New Addon: Campaign Updates

Keep your supporters informed and engaged with every step of your progress! Share the ongoing impact of your mission and build lasting trust with your donor community!

The Ultimate Engagement Tool

Fundraising is a journey, not a one-time event. Now, you can easily provide real-time updates directly on your campaign pages, ensuring your donors stay connected to the causes they care about most.

📣 Easy Storytelling: Quickly post text updates, milestones, or field reports to show exactly how donations are being put to work, keeping the momentum alive throughout your fundraiser.

🏗️ Visual Builder Integration: Seamlessly add the Updates block anywhere on your page using our drag-and-drop builder, or use a simple shortcode to display news in widgets and sidebars.

📩 Build Donor Trust: By consistently sharing progress and success stories, you create a transparent giving experience that encourages recurring support and deeper community involvement.

Integration New

Build Beautiful Fundraising Pages Visually with WPBakery Integration

We are excited to announce our brand-new integration with WPBakery, one of the most popular WordPress page builders, designed to help you create stunning layouts for your campaigns without touching a single line of code.

The Ultimate Design Experience

Designing your nonprofit’s website should be as simple as your mission is powerful. Now, you can bring Charitable functionality directly into your WPBakery workflow, using native elements to build high-converting donation pages and campaign grids in seconds.

🖱️ Drag-and-Drop Building: Easily add donation forms, campaign progress bars, and “Donate Now” buttons to your layouts using the WPBakery elements you already know and love.

🎨 Total Creative Control: Customize the look and feel of your fundraising elements using WPBakery’s native design options. Adjust margins, padding, and borders to ensure your campaigns fit perfectly with your site’s branding.

📱 Seamlessly Responsive: Every element is built to be fully responsive and mobile-friendly, ensuring your donors have a smooth, professional experience whether they are giving from a phone, tablet, or desktop.

Integration New

🖼️ Add Image Galleries to Fundraising Campaigns With Envira Gallery

Showcase the impact of your mission like never before. We are excited to announce our brand-new integration with Envira Gallery, the best WordPress gallery plugin, designed to help you tell your story through powerful, high-performance visuals.

The Ultimate Storytelling Experience

A picture is worth a thousand words – and now, it’s worth even more for your fundraising. Connect your visual impact directly to your cause by creating stunning, responsive galleries that engage donors and drive contributions.

🖼️ Visual Impact: Easily create beautiful, fast-loading galleries to show your nonprofit’s work in action, from field reports to event highlights.

🔗 Seamless Connection: Link gallery images directly to your fundraising campaigns, making it effortless for inspired visitors to go from viewing a photo to making a donation.

📱 Perfectly Responsive: Whether your donors are on a phone, tablet, or desktop, your galleries will look professional and load lightning-fast, ensuring a smooth experience on every device.

Integration New

👉🏻 New Divi Integration In Charitable Pro

Bring the power of Charitable directly into your favorite page builder and maintain total creative control with our brand-new Divi integration.

The Ultimate Design Experience

No more switching back and forth or relying on complex shortcodes. Use dedicated Divi modules to build, style, and launch high-converting donation pages without ever leaving the Divi Builder.

⚡ Native Divi Modules: Effortlessly drag and drop your donation forms, progress bars, and campaign details exactly where you want them.

⚙️ Visual Customization: Tweak colors, fonts, and spacing using Divi’s familiar design settings to ensure your fundraiser matches your brand perfectly.

🚀 Live Visual Editing: See your changes in real-time. What you see in the builder is exactly what your donors will see, ensuring a seamless giving experience every time.

donation form New

👉🏻 New Campaign Selector For Donation Forms

Take your campaign management to the next level. Find the perfect fundraiser for any page and stay in your creative flow with our new Campaign Selector integration.

The Ultimate Selection Tool

No more hunting for IDs or creating one page for every donation form. Use the new Campaign Selector to allow users to switch to a campaign with no code.

⚡ Instant Search: Quickly find any campaign leaving your page or post.

⚙️ Editor Agnostic: Whether you’re using the Block Editor, Elementor, or WPBakery, selecting your campaigns is now a unified experience.

🚀 Real-Time Previews: See exactly which campaign you’ve selected instantly, ensuring your donors always see the right cause.