Skip to content

Instantly share code, notes, and snippets.

@New0 New0/ds-currency-code.php
Last active Feb 28, 2019

Embed
What would you like to do?
Add currency code after Direct Stripe donation input field
<?php
/*
* Plugin Name: DS currency code
* Description: Add currency code after Direct Stripe donation input field
* Version: 0.0.1
* Author: Nicolas Figueira
* Author URI: https://newo.me
*/
add_filter( 'direct_stripe_donation_input', function( $direct_stripe_donation_input, $instance, $button_id ) {
if( $button_id === 'euros-button' ){ // Edit with the CSS ID of button in euros
$text = 'EUR';
} else if( $button_id === 'usd-button' ){ // Edit with the CSS ID of button in usd
$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
You can’t perform that action at this time.