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

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 Country

/** * Add Kosovo to the list of countries in Charitable. */ add_filter( ‘charitable_countries’, function( $countries ) { $countries[‘XK’] = ‘Kosovo’; return $countries; } );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

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

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

Remove Donor Count

/** * An example showing how to do this is provided at https://github.com/Charitable/library/blob/master/general/unhook-default-charitable-template-functions.php. * * It is a more general example that illustrates how to unhook any default Charitable template function. * * @see https://github.com/Charitable/library/blob/master/general/unhook-default-charitable-template-functions.php */Continue reading

Use Page Template For Campaigns

/** * Instead of using the Post template for campaigns, use the Page template as a fallback. * * @param string $template * @return string $template */ function ed_campaigns_use_page_template( $template ) { global $wp_query; if ( is_main_query() && is_singular( ‘campaign’…Continue reading

Remove Stats Summary Block

/** * Remove the campaign summary block (funds raised, number of donors, etc). */ function en_remove_campaign_summary_block() { remove_action( ‘charitable_campaign_content_before’, ‘charitable_template_campaign_summary’, 6 ); // If you still want to show a Donate button, uncomment the line below. // add_action( ‘charitable_campaign_content_before’, ‘charitable_template_donate_button’,…Continue reading