Add Accept Terms Field

/** * Add a Terms and Conditions donation field, showing * whether the donor accepted terms and conditions when * they donated. */ add_action( ‘init’, function() { /* Create the `Charitable_Donation_Field` object. */ $field = new Charitable_Donation_Field( ‘accept_terms’, array( ‘label’…Continue reading

Set WP Login Url To Charitable Login Page

/** * Always use the Charitable login page as the login. * * @param string $login_url The login URL. Not HTML-encoded. * @param string $redirect The path to redirect to on login, if supplied. * @param bool $force_reauth Whether to…Continue reading

Change Donation Cancellation Url

/** * Change the URL that donors are returned to when they cancel their donation. * * @param string $url The default donation cancellation URL. * @param array $args Mixed arguments. * @return string */ function ed_charitable_set_donation_cancellation_url( $url, $args )…Continue reading

Add Pending To Approved Statuses

/** * Make the “Pending” status an approved statuses, so that it is counted in the campaign funds raised. */ function ed_add_pending_to_approved_statuses( $statuses ) { $statuses[] = ‘charitable-pending’; return $statuses; } add_filter( ‘charitable_approval_donation_statuses’, ‘ed_add_pending_to_approved_statuses’ );Continue reading

Add Donate Button

/** * USAGE: * * To display a particular campaign’s button, just add this to your template: ed_charitable_get_campaign_donate_button( 123 ); * Replace 123 with the ID of your campaign. */ /** * Display a donate button for a specific campaign.…Continue reading

Auto Complete Offline Donations

/** * Automatically mark all offline donations as Paid. * * @param boolean $return * @param int $donation_id * @return boolean */ function ed_auto_complete_offline_donation( $return, $donation_id ) { charitable_get_donation( $donation_id )->update_status( ‘charitable-completed’ ); return $return; } add_filter( ‘charitable_process_donation_offline’, ‘ed_auto_complete_offline_donation’, 10,…Continue reading

Allow Manual Donations Without Email

/** * Allow donors to be be added without an email address. * * Prior to Charitable 1.6, this was never permitted. As of Charitable 1.6, it’s possible * to support manual donations without an email address by using this…Continue reading

Change Donor Name Display

/** * Change the donors widget so only the first name and last name * initial of the donor are shown. * * @param string $name The name to be displayed * @param array $args Arguments passed to the donor-loop/donor.php…Continue reading

Include Pending Donors

/** * By default, the Donors widget & shortcode will only include donors with * Paid donations. With this snippet, you can make sure that * donors with Pending donations are also included. */ function ed_include_pending_donors_in_donors_widget_shortcode( $query_args ) { $query_args[‘status’]…Continue reading