Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active June 21, 2017 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/150850af75a79932c533aec061868260 to your computer and use it in GitHub Desktop.
Save joshfeck/150850af75a79932c533aec061868260 to your computer and use it in GitHub Desktop.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function convert_zero_to_free( $amount, $return_raw ) {
if ( ! $return_raw || ! is_admin() ) {
if ( $amount == 0 && is_singular('espresso_events')) {
add_filter(
'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text',
function(){return 'RSVP now';}
);
}
$amount = $amount == 0 ? 'No Cost' : $amount;
}
return $amount;
}
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