Add User Dashboard Menu

/** * By default, Charitable includes a User Dashboard menu, but * this is not automatically added unless the theme builds * in support for it. * * If you want to include the User Dashboard menu at the top…Continue reading

Load Template Files In Admin

/** * Load Charitable template files in the admin area. * * Some plugins or themes attempt to run shortcodes in the admin * area, which can cause a fatal error with Charitable. The core * plugin attempts to avoid…Continue reading

Make Form Fields Required Not Required

/** * This example shows how to make a form field required or not required. * * Our first example below changes the ‘phone’ field in the Donation Form * into a required field; our second example changes the ‘first_name’…Continue reading

Change / Translate Plugin Text

/* * A local translation snippet. Change ‘YOUR TEXT HERE’ to your desired text. * * This snippet will work for any phrases in Charitable and Charitable extensions. */ function charitable_text_switcher( $translations, $text, $domain ) { // Changes the “Donate”…Continue reading

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