Last active
December 25, 2015 09:49
-
-
Save amdrew/6956842 to your computer and use it in GitHub Desktop.
Format the amount in Easy Digital Downloads to remove the decimal points, but only if the number is a whole number.
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 | |
function my_child_theme_edd_format_amount_decimals( $decimals, $amount ) { | |
if( floor( $amount ) == $amount ) | |
$decimals = 0; | |
return $decimals; | |
} | |
add_filter( 'edd_format_amount_decimals', 'my_child_theme_edd_format_amount_decimals', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment