Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Created October 10, 2016 20:21
Show Gist options
  • Save andrasguseo/f628738efeb65fa0e737daef5483035f to your computer and use it in GitHub Desktop.
Save andrasguseo/f628738efeb65fa0e737daef5483035f to your computer and use it in GitHub Desktop.
For Fraser - Remove 'Free' from event prices
<?php
/*
* The Events Calendar - Remove 'Free - ' from price
* Add to your child theme's functions.php file
*/
add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 );
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) {
if ( $cost == 0 || $cost == 'Free' ) {
$cost = str_replace('Free', '', $cost);
$cost = str_replace(' - ', '', $cost);
}
return $cost;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment