Add role that restricts user to post in specific category
You can use the get_terms hook to find all categories and restrict access to them by ID or slug, if the current user is not an admin, or in this specific case if the user doesn’t have the role assigned by you. add_filter(‘get_terms’, ‘restrict_categories’); function restrict_categories($categories) { $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘post.php’) || strpos($_SERVER[‘PHP_SELF’], ‘post-new.php’)); // … Read more