Can I hide specific categories from filter bar for the user there not logged in ?
I habe use this code to hide the categories but it hide for all users.
/* Tribe hide categories from filter */
function tribe_modify_category_filter ( $values, $slug ) {
if ( $slug != ‘eventcategory’ ) return $values;
foreach ( $values as $key => $value ) {
if ( $value[‘name’] == ‘Category Name’ || $value[‘name’] == ‘Category Name 2’ ) {
unset( $values[$key] );
}
}
return $values;
}
add_filter( ‘tribe_events_filter_values’, ‘tribe_modify_category_filter’, 10, 2 );
-
This topic was modified 6 years, 9 months ago by Nicolas.
-
This topic was modified 6 years, 9 months ago by Victor.