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

Add Email Tag For Donation Field

/** * If you want to add an email tag for an existing donation field, * you can use the code sample below. * * To add a completely custom email tag field, you can either register * a field…Continue reading

Add Custom Campaign Field

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

Remove Donation Form Fields

/** * This example shows how to remove fields from the donation form. * * Note that this approach requires Charitable 1.6 or above. */ add_action( ‘init’, function() { $fields_api = charitable()->donation_fields(); /** * In this example, we remove the…Continue reading

Change Postcode To Zipcode

/** * Change the “Postcode” field into a “ZIP Code” field. * * @param array[] $fields * @return array[] */ add_action( ‘init’, function ( $fields ) { $fields = charitable()->donation_fields(); $field = $fields->get_field( ‘postcode’ ); $field->label = ‘ZIP Code’; $field->set(…Continue reading