Last active
January 15, 2020 02:41
-
-
Save skyshab/9612a0ec5b7ac6753794a045c545959f to your computer and use it in GitHub Desktop.
Remove "free" when there's another price, including the "-"
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 | |
// don't show Event cost when 'free' or not set. | |
add_filter ('tribe_get_cost', function($cost) { | |
if ( strpos($cost, 'Free - ') !== false ) { | |
return str_replace('Free - ', '', $cost); | |
} | |
return ( $cost === 0 || $cost === 'Free' ) ? '' : $cost; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. How do you override the filter when an RSVP form is active? It works perfect without RSVP form. I guess they're adding a filter later than this?