Documentation Category: For Developers

  • Hooks and filters in Annual Receipts

    Like all Charitable extensions, Charitable Annual Receipts is designed to be developer-friendly, with hooks and filters that will help you customize it to your needs. Filters Action

  • Hooks and filters in Automation Connect

    Like all Charitable extensions, Charitable Automation Connect is designed to be developer-friendly, with hooks and filters that will help you customize it to your needs. Filters Action

  • User Roles and Permissions

    Charitable adds two new user roles. In addition, Charitable Ambassadors adds an additional user role. Roles Donor The donor role is given to users after they make a donation. Permissions: read Campaign Manager The campaign_manager role gives a user the ability view Charitable campaigns and donations in the admin, without being able to change settings.…

  • Donation Fields API

    The Donation Fields API is provides a powerful, flexible way to add, remove and edit your donation fields. What are donation fields? How do I get the value for a particular field? How do I add a new field to my donation form? How do I change an existing donation field? How do I add…

  • Charitable_Donation_Field

    The Charitable_Donation_Field class allows you to create new donation fields or edit existing ones. Table of Contents Usage Create a new donation field Get an existing donation field Properties Methods __construct set __set __get Usage Create a new donation field If you want to add a new donation field, you will first need to create…

  • Hooks and filters in Stripe

    Like all Charitable extensions, Charitable Stripe is designed to be developer-friendly and includes hooks and filters that will help you make any customizations you need. Filters Action Hooks

  • Charitable_User

    The Charitable_User class allows you to get access to information about a particular user. Charitable_User is a sub-class of WP_User. Getting an instance of Charitable_User Given a user ID, you can retrieve a Charitable_User instance in one of two ways: The advantage of using charitable_get_user is that it uses the object cache to retain the…

  • Charitable_Donor

    The Charitable_Donor class allows you to get access to information about a particular donor. Getting an instance of Charitable_Donor A Charitable_Donor instance can be retrieved in different ways depending on the context in which you need to use it. With a donor ID With a donor ID and a donation ID With a donation object…

  • Charitable_Campaign

    The Charitable_Campaign class allows you to get information about a particular campaign. Getting an instance of Charitable_Campaign There are two primary ways to get a Charitable_Campaign object: While both options work, we recommend using charitable_get_campaign for forward-compatibility (in case we add object caching for campaigns or filtering). Class source code Methods get( $meta_name, $single = true ) Get a…

  • Hooks & Filters in Fee Relief

    Filters charitable_fee_relief_theme_template_path Customize the directory to use for template files in themes/child themes. Returns: String. Set to charitable/charitable-fee-relief by default. Arguments: None. Usage: add_filter( ‘charitable_fee_relief_theme_template_path’, function( $path ) { return ‘my-custom-template-path’; } ); charitable_fee_relief_languages_directory Customize the directory to use for translation files. Returns: String. Set to charitable-fee-relief/languages by default. Arguments: None. Usage: add_filter( ‘charitable_fee_relief_languages_directory’, function(…

  • Setting up a Stripe Webhook

    Note: Most of the time, you will not need to create a Stripe webhook manually, as Charitable will set one up for you automatically. However, if something goes wrong with that process, you can follow the steps below to (re)set up your webhook manually or to confirm your webhooks exist in Stripe. What is a…

  • Account Filters

    Filters charitable_disable_admin_bar Sets whether the admin bar should be disabled for everyone who does not have edit_posts or manage_charitable_settings caps. Returns: Boolean. true by default. Return false to enable the admin bar for everyone. Arguments: None. Usage: add_filter( ‘charitable_disable_admin_bar’, ‘__return_false’ ); charitable_disable_admin_access Sets whether admin access should be disabled for everyone who does not have…

  • The Email Fields API

    The Email Fields API was introduced in version 1.5 and provides a cleaner way to add new email tags or modify existing ones. Defining a Field An email field is defined as an array with a few arguments, and a key which is used for the show parameter in the [charitable_email] shortcode. Arguments description: The description that…