Skip to content

Instantly share code, notes, and snippets.

@skyshab
Last active January 15, 2020 02:41
Show Gist options
  • Save skyshab/9612a0ec5b7ac6753794a045c545959f to your computer and use it in GitHub Desktop.
Save skyshab/9612a0ec5b7ac6753794a045c545959f to your computer and use it in GitHub Desktop.
Remove "free" when there's another price, including the "-"
<?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;
})
@localpath
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment