Last active
August 29, 2015 14:00
-
-
Save jazbek/11382578 to your computer and use it in GitHub Desktop.
Filter a category out of the filter bar options
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 | |
add_filter( 'tribe_events_filter_values', 'tribe_filter_event_categories', 10, 2 ); | |
function tribe_filter_event_categories( $values, $slug ) { | |
if ( $slug == 'eventcategory' ) { | |
foreach ( $values as $i => $category ) { | |
if ( $category['name'] == 'Event Category 1' ) { | |
unset ( $values[$i] ); | |
break; | |
} | |
} | |
} | |
return $values; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment