OK, so you have few mistakes in there.
field
can beterm_id
orslug
, but notid
.tax_query
should be array of arrays and not an array.
So here is fixed code:
function exclude_category( $query ) {
if ( is_user_logged_in() && $query->is_main_query() ) {
$taxquery = array(
array(
'taxonomy' => 'project-type',
'field' => 'term_id',
'terms' => array( 94 ),
'operator' => 'NOT IN'
),
);
$query->set( 'tax_query', $taxquery);
}
}
add_action( 'pre_get_posts', 'exclude_category' );
It’s not tested, but I’m pretty sure it should work just fine.