You’ll have to change see_special_cats
to something fitting. As you want to exclude contributors, but allow all others, you could use publish_posts
(See the codex for all capabilities of contributors).
Your code should be something like
add_filter('list_terms_exclusions', 'yoursite_list_terms_exclusions', 10, 2);
function yoursite_list_terms_exclusions( $exclusions, $args ) {
global $pagenow;
if (in_array($pagenow,array('post.php','post-new.php')) &&
!current_user_can('publish_posts')) {
$exclusions = " {$exclusions} AND t.slug NOT IN ('news', 'blog', 'main')";
}
return $exclusions;
}
Keep in mind that you might have to adjust the slugs, which I’ve just assumed are news
, blog
and main
.