Skip to content

Instantly share code, notes, and snippets.

@New0
Created August 28, 2018 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save New0/b267e342069d54505c2afbe99e4b1124 to your computer and use it in GitHub Desktop.
Save New0/b267e342069d54505c2afbe99e4b1124 to your computer and use it in GitHub Desktop.
Add the currency the Direct Stripe donation button is set with.
<?php
//We add a span tag that holds the currency text corresponding to a donation button
add_filter( 'direct_stripe_donation_input', function( $direct_stripe_donation_input, $instance, $button_id ) {
if( $button_id === 'ds-dons' ){ // $button_id is the CSS ID set in the button settings
$text = 'EUR';
} else if( $button_id === 'ds-donation' ){ // $button_id is the CSS ID set in the button settings
$text= 'USD';
}
$direct_stripe_donation_input .= '<span class="curency-info">' . $text . '</span>';
return $direct_stripe_donation_input;
}, 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment