Show Admin Bar

/** * By default, Charitable hides the admin bar from users * who do not have one of the `edit_posts`, * `manage_charitable_settings`, or `edit_products` * capabilities. * * The code below shows the admin bar for logged in users who…Continue reading

Allow Admin Access

/** * By default, Charitable disables admin access for users * who do not have one of the `edit_posts`, * `manage_charitable_settings`, or `edit_products` * capabilities. * * The code below enables access for logged in users who do * not…Continue reading

Add Campaign Link

/** * Add a link back to the campaign from the donation receipt. */ function ed_add_campaign_link_to_receipt( $donation ) { $campaigns = $donation->get_campaign_donations(); // We’re just linking to the first campaign. $campaign_donation = current( $campaigns ); ob_start(); ?>Continue reading

Add Campaign Raised Summary

/** * Add a short summary after the donation details showing the funds raised by each campaign. */ function ed_add_campaign_stats_to_receipt( $donation ) { $campaigns = $donation->get_campaign_donations(); ob_start(); printf( ‘ %s ‘, __( ‘Campaign Stats’ ) ); foreach ( $campaigns as…Continue reading

Set Default Highlight Colour

/** * NOTE: This snippet will not work in versions of Charitable prior to 1.2. * * Set the default colour used by Charitable. * * @return string */ function en_set_default_highlight_colour() { return ‘#123456’; } add_filter( ‘charitable_default_highlight_colour’, ‘en_set_default_highlight_colour’ );Continue reading

Set Campaign Thumbnail Size

/** * If you want all campaign thumbnails to have the same size, you can use the * snippet below. Note that images will be hard-cropped, so part of the image * may be cropped out. * * If you…Continue reading

Remove Campaign Description

/** * Remove the campaign descriptions from the campaign loop. */ function en_remove_campaign_description_in_loop() { remove_action( ‘charitable_campaign_content_loop_after’, ‘charitable_template_campaign_description’, 4 ); } add_action( ‘after_setup_theme’, ‘en_remove_campaign_description_in_loop’, 11 );Continue reading