• Resolved k2learner

    (@k2learner)


    Hi

    I put this code into code snippets plugin (works like a charm for donation form – user section fields) but it is not able to change the label (tried changing the placeholder text – did not work also).

    Can you please help?

    function ed_charitable_change_donation_form_donation_fields( $fields ) {
    /**
    * Change the label of the Donation Amount field.
    */
    $fields[‘donation_amount’][‘label’] = __( ‘Donation – Min $100’, ‘your-namespace’ );

    /**
    * Change the placeholder shown inside the field when it hasn’t been set yet.
    */
    $fields[‘donation_amount’][‘placeholder’] = __( ‘Min $100’, ‘your-namespace’ );

    return $fields;

    }
    add_filter( ‘charitable_donation_form_donation_fields’, ‘ed_charitable_change_donation_form_donation_fields’ );

    • This topic was modified 8 years ago by k2learner.
    • This topic was modified 8 years ago by k2learner.
    • This topic was modified 8 years ago by k2learner.
Viewing 1 replies (of 1 total)
  • Eric Daams

    (@ericdaams)

    Hi @k2learner,

    The Donation Amount field is a bit different. It uses a custom template that cannot be tweaked in the same way.

    That said, you can override the template. The template to override is charitable/templates/donation-form/donation-amount-list.php

    Create a copy of this file in your theme at yourtheme/charitable/donation-form/donation-amount-list.php. You can then edit the copy in your theme to make the changes you want.

    Also note that you can set the minimum donation amount with this code snippet:

    https://github.com/Charitable/library/blob/master/donation-form/set-minimum-donation-amount.php

    Cheers,
    Eric

    • This reply was modified 8 years ago by Eric Daams.
Viewing 1 replies (of 1 total)

The topic ‘Donation Form Donation Amount Hook not working’ is closed to new replies.