Skip to content

Instantly share code, notes, and snippets.

@New0
Last active February 28, 2019 08:50
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/ac7fdc883a8cae28a2019824c94a00ac to your computer and use it in GitHub Desktop.
Save New0/ac7fdc883a8cae28a2019824c94a00ac to your computer and use it in GitHub Desktop.
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