Last active
February 28, 2019 08:50
-
-
Save New0/ac7fdc883a8cae28a2019824c94a00ac to your computer and use it in GitHub Desktop.
Add currency code after Direct Stripe donation input field
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 | |
/* | |
* 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