You’d have to add a function during the init
action of WP. There you’ll get the current user
and check whether they have a specific role
assigned to them and redirect
to the page when they do.
add_action('init', function () {
$user = wp_get_current_user();
$role="your role";
if (in_array($role, $user->roles)) {
wp_redirect('url');
}
});
WordPress Function References:
- https://developer.wordpress.org/reference/functions/add_action/
- https://developer.wordpress.org/reference/functions/wp_get_current_user/
- https://developer.wordpress.org/reference/functions/wp_redirect/
Relevant SE posts:
solved Restricting users to a specific front end page [closed]