Created
July 18, 2017 23:35
-
-
Save vicskf/25dbbbf37566c217bee598b2d44344d5 to your computer and use it in GitHub Desktop.
TEC Filter Bar > Tribe hide dayofweek options from filter Bar
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 | |
/* Tribe hide dayofweek option from filter */ | |
function tribe_modify_category_filter ( $values, $slug ) { | |
if ( $slug != 'dayofweek' ) return $values; | |
foreach ( $values as $key => $value ) { | |
// If Monday, Tuesday or Wednesday then unset the values | |
if ( $value['value'] == '2' || $value['value'] == '3' || $value['value'] == '4') { | |
unset( $values[$key] ); | |
} | |
} | |
return $values; | |
} | |
add_filter( 'tribe_events_filter_values', 'tribe_modify_category_filter', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment