Last active
August 29, 2015 13:57
-
-
Save nerrad/9644575 to your computer and use it in GitHub Desktop.
Usage of FHEE__EEH_Template__format_currency__amount filter to return free instead of 0.00 for free tickets
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 | |
function convert_zero_to_free( $amount, $return_raw ) { | |
// we don't want to mess with requests for unformated values because those may get used in calculations | |
return $return_raw || $amount >= 0 ? $amount : __('free', 'event_espresso'); | |
} | |
add_filter( 'FHEE__EEH_Template__format_currency__amount', 'convert_zero_to_free', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment