Last active
July 28, 2021 17:21
-
-
Save wpweb101/e2a67915371a9fee728f to your computer and use it in GitHub Desktop.
replace edd currency symbol with points
This file contains 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 | |
if( class_exists( 'Easy_Digital_Downloads' ) ) { | |
$currency = edd_get_currency(); // get edd base currency | |
add_filter( 'edd_' . strtolower( $currency ) . '_currency_filter_before', 'edd_cur_change_before_format', 10, 3 ); | |
add_filter( 'edd_' . strtolower( $currency ) . '_currency_filter_after', 'edd_cur_change_after_format', 10, 3 ); | |
function edd_cur_change_before_format($formatted, $currency, $price) { | |
return 'points '.$price; | |
} | |
function edd_cur_change_after_format($formatted, $currency, $price) { | |
return $price. ' points'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment