Set Custom Redirection After Registration

/** * Send the user to a custom page after they have registered. * * @param array[] $fields * @return array[] $fields */ function en_set_custom_redirection_after_registration( $fields ) { if ( ! isset( $_GET[ ‘redirect_to’ ] ) ) { $fields[ ‘redirect_to’…Continue reading

Send New User Notifications

/** * Send the new user notification after someone registers * through the Charitable registration form. */ add_action( ‘charitable_after_insert_user’, ‘wp_send_new_user_notifications’ );Continue reading

Customize Donation Stats

/** * Customize the stats that are shown in the Donation Stats widget. * * In this example, we only show the stats specific to a particular category. * * @param array $donation_stats The default stats to show. * @return…Continue reading

Send Notifications On User Registration

/** * Notify admin and user when a user registers with Charitable. * * @param array[] $fields * @param Charitable_Donation_Form $form * @return array[] */ function charitable_notify_new_user($user_id, $values) { wp_new_user_notification( $user_id, null, ‘admin’ ); } add_action(‘charitable_after_insert_user’, ‘charitable_notify_new_user’, 10, 2);Continue reading

Add Country

/** * Add Kosovo to the list of countries in Charitable. */ add_filter( ‘charitable_countries’, function( $countries ) { $countries[‘XK’] = ‘Kosovo’; return $countries; } );Continue reading

Change Currency Format By Locale

/** * By default, Charitable allows you to specify a single currency format * for the whole site. However, if you are running a multi-lingual * fundraising website, you may want to use a different format for each * language.…Continue reading

Add Currency

/** * Add a new currency. * * @param string[] $currencies The list of registered currencies. * @return string[] */ function ed_charitable_add_currency( $currencies ) { /** * We’re adding the Armenian Dram currency (AMD). * * Note that the three-letter…Continue reading

Add Hours Currency

/** * Add a custom currency called “Hours”. * * @param string[] $currencies * @return string[] $currencies */ function en_add_hours_currency( $currencies ) { $currencies[ ‘HOURS’ ] = __( ‘Hours’, ‘your-namespace’ ); return $currencies; } add_filter( ‘charitable_currencies’, ‘en_add_hours_currency’ );Continue reading

Add Campaign Creator Export Fields

/** * Add additional campaign fields related to the campaign creator. * * @param array $columns The list of columns. * @return array */ function ed_charitable_add_creator_campaign_fields() { $creator_fields = array( ‘organization’ => __( ‘Campaign Creator Organization’, ‘your-namespace’ ), ‘address’ =>…Continue reading

Format Date

/** * Change the date format of the “Date of Donation” column in the Donations export. * * @param mixed $value The value to set. * @param string $key The key to set. * @param array $data The set of…Continue reading