Created
October 10, 2016 20:21
-
-
Save andrasguseo/f628738efeb65fa0e737daef5483035f to your computer and use it in GitHub Desktop.
For Fraser - Remove 'Free' from event prices
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 | |
/* | |
* 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