Created
August 28, 2018 07:59
-
-
Save New0/b267e342069d54505c2afbe99e4b1124 to your computer and use it in GitHub Desktop.
Add the currency the Direct Stripe donation button is set with.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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