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

Disable Donation Receipt For Offline Donations

/** * 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

Collect National Id Number

/** * 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

Copy Donation Receipt To Admin

/** * 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

Add Gateway Donation Field

/** * 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

Add Offline Instructions Field

/** * 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