Charitable Documentation

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

Charitable Divi Integration

This guide is a technical reference for developers working with Charitable’s Divi integration. Divi integration was introduced in Charitable Pro 1.8.12.

Overview

The Charitable Divi integration provides four custom modules for the Divi Builder. The integration uses Divi’s legacy ET_Builder_Module API for maximum compatibility with both Divi 4 and Divi 5.

Architecture

The integration follows a similar pattern to Charitable’s Elementor and WPBakery integrations:

  • Main Integration Class: Singleton pattern, handles detection and module registration
  • Module Classes: Each module extends ET_Builder_Module
  • Shortcode-Based Rendering: Modules leverage existing Charitable shortcodes for output
  • Computed Fields: Used for Visual Builder live previews via AJAX

Divi 4 vs Divi 5 Compatibility

The integration is built on Divi’s legacy module API (ET_Builder_Module) rather than the newer Divi 5 ModuleRegistration system. This approach was chosen for:

  • Backward Compatibility: Works with both Divi 4 and Divi 5
  • Stability: Uses a well-documented, proven API
  • Simplicity: Leverages existing shortcode infrastructure

The integration has been tested with:

  • Divi Theme 4.x
  • Divi Theme 5.x
  • Divi Builder Plugin (standalone)
  • Extra Theme

Disabling the Integration

To completely disable the Divi integration, add this constant to wp-config.php:

define( ‘CHARITABLE_DISABLE_DIVI_INTEGRATION’, true );

This prevents the integration from loading entirely, which can be useful for:

  • Troubleshooting conflicts
  • Sites not using Divi
  • Custom implementations

Module Slugs

ModuleSlugShortcode Used
Campaigncharitable_campaign[campaign id=”X”]
Campaignscharitable_campaigns[campaigns …]
Donation Formcharitable_donation_form[charitable_donation_form …]
Donate Buttoncharitable_donate_button[charitable_donate_button …]

Hooks and Filters

Actions

Module Registration

// Modules are registered on this Divi hook

add_action( ‘et_builder_ready’, [ $this, ‘register_modules’ ] );

Cache Clearing

// Campaign options cache is cleared when campaigns change

add_action( ‘save_post_campaign’, [ $this, ‘clear_campaign_options_cache’ ] );

add_action( ‘delete_post’, [ $this, ‘clear_campaign_options_cache’ ] );

add_action( ‘wp_trash_post’, [ $this, ‘clear_campaign_options_cache’ ] );

Filters

Module Categories

// Custom category registration

add_filter( ‘et_builder_categories’, [ $this, ‘register_module_category’ ] );

Caching

The integration caches campaign dropdown options to improve performance:

  • Transient Key: charitable_divi_campaign_options
  • Duration: 1 hour (HOUR_IN_SECONDS)
  • Auto-cleared: When campaigns are saved, deleted, or trashed

To manually clear the cache:

delete_transient( ‘charitable_divi_campaign_options’ );

Visual Builder Considerations

Preview Mode

The Donation Form module displays a placeholder in the Visual Builder instead of the actual form. This is intentional because:

  1. Forms require JavaScript that may conflict with the builder
  2. Form submissions in preview mode could cause issues
  3. Performance is improved with static placeholders

The actual form renders correctly on the frontend.

AJAX Data Attributes

The Campaigns shortcode normally outputs data-shortcode-atts for AJAX pagination. In the Visual Builder context, this is stripped to prevent display issues. The integration detects the VB context and adds a preview=”1″ attribute to the shortcode.

Computed Fields

Each module uses Divi’s computed fields system for live previews:

‘__campaign_preview’ => [

    ‘type’                => ‘computed’,

    ‘computed_callback’   => [ ‘Charitable_Divi_Campaign_Module’, ‘get_campaign_preview’ ],

    ‘computed_depends_on’ => [

        ‘campaign_id’,

    ],

],

When a user changes a setting in the Visual Builder, Divi calls the computed callback via AJAX to refresh the preview.

CSS Selectors

Module Container Classes

ModuleContainer Class
Campaign.et_pb_charitable_campaign
Campaigns.et_pb_charitable_campaigns
Donation Form.et_pb_charitable_donation_form
Donate Button.et_pb_charitable_donate_button

Common Element Selectors

/* Campaign titles */

.et_pb_charitable_campaign .campaign-title,

.et_pb_charitable_campaigns .campaign-title { }

/* Progress bars */

.campaign-progress,

.progress-bar { }

/* Donate buttons */

.donate-button,

.charitable-button { }

/* Form fields */

.charitable-donation-form input[type=”text”],

.charitable-donation-form select { }

Debugging

Enable WordPress Debug Mode

// wp-config.php

define( ‘WP_DEBUG’, true );

define( ‘WP_DEBUG_LOG’, true );

Common Issues

Modules not appearing in builder:

  • Verify Divi theme/plugin is active: function_exists( ‘et_setup_theme’ )
  • Check that Charitable is fully loaded before Divi initializes
  • Look for PHP errors in wp-content/debug.log

Styling not applying:

  • Clear Divi’s static CSS cache: Divi → Theme Options → Builder → Advanced → Static CSS File Generation
  • Check CSS specificity; Divi uses high specificity selectors
  • The integration uses !important on advanced field CSS for this reason

Campaign dropdown empty:

  • Ensure campaigns exist with “Published” status
  • Check if the transient cache needs clearing
  • Verify post_type_exists( ‘campaign’ ) returns true

Preview not updating:

  • Check browser console for JavaScript errors
  • Verify AJAX requests are completing (Network tab)
  • Ensure computed_depends_on includes the field being changed

Detection Methods

The integration uses multiple methods to detect Divi:

// Check for Divi Builder plugin

class_exists( ‘ET_Builder_Plugin’ )

// Check for Divi functions

function_exists( ‘et_setup_theme’ )

function_exists( ‘et_builder_should_load_all_module_data’ )

// Check for Divi/Extra theme

in_array( get_template(), [ ‘Divi’, ‘Extra’ ] )

Visual Builder Detection

// Frontend Visual Builder

isset( $_GET[‘et_fb’] )

// Backend builder

isset( $_GET[‘et_pb_preview’] )

// AJAX context (for preview rendering)

defined( ‘DOING_AJAX’ ) && DOING_AJAX

Extending the Integration

Adding Custom Fields to a Module

To add fields to an existing module via a child theme or plugin, you would need to extend the module class:

class My_Custom_Campaign_Module extends Charitable_Divi_Campaign_Module {

    public function get_fields() {

        $fields = parent::get_fields();

        // Add custom field

        $fields[‘custom_field’] = [

            ‘label’           => ‘My Custom Field’,

            ‘type’            => ‘text’,

            ‘option_category’ => ‘basic_option’,

            ‘toggle_slug’     => ‘main_content’,

        ];

        return $fields;

    }

}

Note: This requires re-registering the module, which is an advanced customization.

Custom Module Category Icon

The Charitable category icon is set via CSS injection rather than Divi’s icon property (which doesn’t support custom SVGs for categories):

li.charitable.et_pb_folder::before {

    content: ” !important;

    background-image: url(‘path/to/icon.svg’) !important;

    background-size: contain !important;

}

Version History

VersionChanges
1.8.12Initial Divi integration release

Support

For issues specific to the Divi integration:

  1. Check this documentation for known solutions
  2. Enable WP_DEBUG and check for errors
  3. Test with a default Divi layout to rule out theme conflicts
  4. Contact Charitable support with debug information

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!

Donations Live New

👉🏻 Showcase Real Momentum with the Donations Feed

Give your donors a reason to trust. Our new feed lets you display a living, breathing record of people showing up for your cause.

🤝 Build instant trust: Overcome donor hesitation by showing a proven track record of community support.
💬 Highlight donor stories: Display real donor comments and locations to show the human side of your fundraising.
🛠️ Drop it anywhere: Easily add the block to your homepage, campaign pages, or confirmation screens in seconds.
📈 Curate your feed: Group multiple donations from the same person or sort by highest amounts to encourage larger gifts.

Campaigns New

🎨 Campaign Showcase: Pro Level Display, No Coding Needed.

Display your causes with style and make it easier than ever for donors to find the right campaign. We are excited to announce the brand-new Campaign Showcase, a powerful, no-code tool designed to help you create beautiful, high-converting campaign grids and carousels.

The Ultimate Discovery Experience

Your mission deserves to be seen. With the Campaign Showcase, you can move beyond simple lists and create dynamic displays that highlight your most urgent needs, helping donors connect with the causes they care about most.

⚡ No-Code Customization: Effortlessly change layouts, columns, and styles with a single click. Whether you want a clean grid or an interactive carousel, you can match your organization’s look without any CSS or JavaScript.

🎯 Advanced Search & Filter: Empower your supporters with real-time filtering. Donors can quickly sort through campaigns by tags, popularity, or “ending soon,” making it easy to find exactly where their help is needed.

💰 Quick Donate Integration: Boost your conversions with instant giving. The Showcase allows donors to contribute via a modal popup directly from the display, featuring pre-selected amounts for a faster, friction-free experience.

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.