Add Read More Link
/** * Add a Read More link to the campaigns in the campaign grid. * * Note: This is designed to be used for cases where you want a Read More link * as well as a Donate button. If…Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * Add a Read More link to the campaigns in the campaign grid. * * Note: This is designed to be used for cases where you want a Read More link * as well as a Donate button. If…Continue reading
/** * Display the custom field. * * @param Charitable_Campaign $campaign * @return void */ function ed_charitable_add_custom_field_to_campaign_grid( $campaign ) { echo $campaign->get( ‘my_custom_field’ ); } /** * You can adjust where the custom field is inserted by changing the priority,…Continue reading
/** * 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
/** * Display a specific campaign’s donation form using a shortcode. * * After adding this code snippet, you can include any donation form with the following shortcode: * * [charitable_donation_form campaign=123] // Replace 123 with the ID of your…Continue reading
/** * In Charitable 1.5, the method for registering new * donation fields has become much simpler. The old way * will still work, but it’s more cumbersome and requires * much more code for the same effect. * *…Continue reading
/** * Change the section headers in the donation form. * * @param array $fields All the donation form fields. * @return array */ function ed_charitable_change_donation_form_section_headers( $fields ) { // “Your Donation” $fields[‘donation_fields’][‘legend’] = ‘Choose Your Donation Amount’; // “Details”…Continue reading
/** * Add placeholder attributes to donation fields, removing the label field. * * @return void */ add_action( ‘init’, function() { $fields = charitable()->donation_fields(); foreach ( $fields->get_donation_form_fields() as $field ) { $label = $field->donation_form[‘label’]; if ( isset( $field->donation_form[‘required’] ) &&…Continue reading
/** * Page caching causes problems for donors who are not logged in. * * This filter disables the nonce check for non-logged in donors. Since this * is provides less protection than the normal nonce check, it is not…Continue reading
/** * This example shows how to add a new donation field to your site, but * only display it in the front-end donation form for a particular campaign. * * Related examples: * * @see Register a text field…Continue reading
/** * Remove the login prompt from being displayed before the donation form. */ function ed_remove_login_form_before_donation_form() { remove_action( ‘charitable_donation_form_before’, ‘charitable_template_donation_form_login’, 4 ); } add_action( ‘after_setup_theme’, ‘ed_remove_login_form_before_donation_form’, 20 );Continue reading