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
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * 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
/** * This example shows how to remove columns from the Donations export. * * Since this relies on the Donation Fields API, it requires Charitable 1.5+. * * For a way of doing this on older versions of Charitable,…Continue reading
/** * In this example, the campaign creator’s name is added to the Donations * export, so it’s easy to see who created the campaign that received the * donation when exporting the donations. */ add_action( ‘init’, function() { $field…Continue reading
/** * This example shows how to remove columns from the Donations export. * * Since this relies on the Donation Fields API, it requires Charitable 1.5+. * * For a way of doing this on older versions of Charitable,…Continue reading
/** * By default, Charitable shows a “Campaign Categories” column in the * donations export, which lists the names of the categories that the * campaign is in. * * In some cases, it may be more helpful to show…Continue reading
/** * 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
/** * 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
/** * Customizes the definition of the campaign post type, setting the * with_front option to false. * * @param array $post_type_args * @return array */ function ed_set_campaign_post_type_to_not_use_front( $post_type_args ) { $post_type_args[‘rewrite’][‘with_front’] = false; return $post_type_args; } add_filter( ‘charitable_campaign_post_type’, ‘ed_set_campaign_post_type_to_not_use_front’…Continue reading
/** * Change the notice shown for campaigns when they are finished. * * This notice is only shown in certain themes (Reach, for example). */ add_filter( ‘charitable_campaign_finished_notice’, function( $message, Charitable_Campaign $campaign ) { /* If the campaign is ongoing,…Continue reading
/** * By default, campaigns are located at yoursite.com/campaigns/campaign-name. * * If you want to change the /campaigns/ bit to something else, you * can modify the campaign post type definition using the example below. * * In this example,…Continue reading