Add Dynamic Hidden Field
/** * In this example, a new donation field is created but left out of the * front-end donation form. Instead, it is dynamically set as a hidden * field in the donation form, based on the ID of the…Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * In this example, a new donation field is created but left out of the * front-end donation form. Instead, it is dynamically set as a hidden * field in the donation form, based on the ID of the…Continue reading
/** * If you want to add multiple new fields to your donation form, * you can do that in a single function. * * In the example below, we add three separate fields: * * – a text field…Continue reading
/** * Add a text field to the donation form. * * This field is added to the donor details section (by default, this is the section * with a header of “Your Details”). In the example below, we add…Continue reading
/** * After a user logs in, redirect them back to the page they * were on right before going to the login page. * * @see wp_login_form * @uses wp_get_referer * * @param array $args The default arguments that…Continue reading
/** * The `charitable_login_form_args` filter allows you to set * the arguments that are passed to wp_login_form(). * * In this example, we change the URL that people are redirected * to after logging in through the form generated by…Continue reading
/** * 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
/** * 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
/** * 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
/** * 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
/** * 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