Hi again,
I’m no pro, but I managed to “get it done” with inspiration from your previous reply + a little help from google.
If anyone else needs it, this is what I added to my child theme’s “functions.php:
// Removes categories “test1” and “test2” for users not logged in
add_action( ‘pre_get_posts’, ‘exclude_events_category’ );
function exclude_events_category( $query ) {
get_currentuserinfo() ;
global $user_level;
if ($user_level == 0) {
$query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'slug',
'terms' => array('test1', 'test2'),
'operator' => 'NOT IN'
)
)
);
}
return $query;
}
This hides chosen categories for users not logged in and by creating a category called e.g. “maybe”, the community members can add to a hidden category and then change to a visible category, when they want the event to be visible to all…