Skip to content

Instantly share code, notes, and snippets.

@wpweb101
Last active July 28, 2021 17:21
Show Gist options
  • Save wpweb101/e2a67915371a9fee728f to your computer and use it in GitHub Desktop.
Save wpweb101/e2a67915371a9fee728f to your computer and use it in GitHub Desktop.
replace edd currency symbol with points
<?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