Add Email Headers

/** * Add CC/BCC headers to Charitable emails. * * @param string $headers The default email headers. * @param Charitable_Email $email The email object. * @return string */ function ed_charitable_add_email_headers( $headers, $email ) { /** * If you would only…Continue reading

Add Checkbox Field To Donation Form

/** * Collect a checkbox field in the donation form. * * This snippet only works in Charitable 1.5 or above. * * Related examples: * * @see Register a text field (detailed example) – https://github.com/Charitable/library/blob/master/donation-form/register-new-donation-field-1.5.php * @see Register multiple…Continue reading

Add Custom Donation Field

/** * This example shows how you can add a new donation field to be displayed * in Charitable emails related to donations. */ /** * Register the extra field. * * @param array $fields * @param Charitable_Email $email *…Continue reading

Add Dynamic Hidden Field

/** * In this example, a new donation field is created but left out of the * front-end donation form. Instead, it is dynamically set as a hidden * field in the donation form, based on the ID of the…Continue reading

Add Donate Button

/** * USAGE: * * To display a particular campaign’s button, just add this to your template: ed_charitable_get_campaign_donate_button( 123 ); * Replace 123 with the ID of your campaign. */ /** * Display a donate button for a specific campaign.…Continue reading

Add Pending To Approved Statuses

/** * Make the “Pending” status an approved statuses, so that it is counted in the campaign funds raised. */ function ed_add_pending_to_approved_statuses( $statuses ) { $statuses[] = ‘charitable-pending’; return $statuses; } add_filter( ‘charitable_approval_donation_statuses’, ‘ed_add_pending_to_approved_statuses’ );Continue reading

Change Donation Cancellation Url

/** * Change the URL that donors are returned to when they cancel their donation. * * @param string $url The default donation cancellation URL. * @param array $args Mixed arguments. * @return string */ function ed_charitable_set_donation_cancellation_url( $url, $args )…Continue reading

Set WP Login Url To Charitable Login Page

/** * Always use the Charitable login page as the login. * * @param string $login_url The login URL. Not HTML-encoded. * @param string $redirect The path to redirect to on login, if supplied. * @param bool $force_reauth Whether to…Continue reading