Register Multiple Donation Fields
/** * If you want to add multiple new fields to your donation form, * you can do that in a single function. * * In the example below, we add three separate fields: * * – a text field…Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * If you want to add multiple new fields to your donation form, * you can do that in a single function. * * In the example below, we add three separate fields: * * – a text field…Continue reading
/** * Disable the donation receipt email for offline donations. */ add_filter( ‘charitable_send_donation_receipt’, /** * Our callback function. * * @param boolean $send_email Whether to send the email. * @param Charitable_Donation $donation The donation object. * @return boolean Whether to…Continue reading
/** * Add a text field to the donation form. * * This field is added to the donor details section (by default, this is the section * with a header of “Your Details”). In the example below, we add…Continue reading
/** * Send the donation receipt to the site admin as well. * * @param string|string[] $recipients * @return string[] $recipients */ function en_copy_donation_receipt_to_admin( $recipients ) { /** * If it isn’t an array, cast it to one. */ if…Continue reading
/** * This snippet shows how to enable an email tag for the gateway_label * donation field. * * This same pattern can be used to enable email tags for other * donation fields. Find a list of the default…Continue reading
/** * Right after a donation is made, this sends a notification to admin if * the donation is pending AND it was made in offline mode. * * @param int $donation_id * @return boolean */ function en_send_donation_notification_for_pending_offline( $donation_id )…Continue reading
/** * This example shows how you can add a new field to your donation-related * emails which shows the offline payment instructions for offline donations. */ /** * Register the extra field. * * @param array $fields * @param…Continue reading
/* * A local translation snippet. Change ‘YOUR TEXT HERE’ to your desired text. * * This snippet will work for any phrases in Charitable and Charitable extensions. */ function charitable_text_switcher( $translations, $text, $domain ) { // Changes the “Donate”…Continue reading
/** * This example shows how to make a form field required or not required. * * Our first example below changes the ‘phone’ field in the Donation Form * into a required field; our second example changes the ‘first_name’…Continue reading
/** * Unhook default Charitable template functions. * * In this example, we’re going to remove the donor count from the campaign * page, but you can adapt this to unhook any template functions that are * added by Charitable.…Continue reading