Plugin Support
Emma
(@emma24)
Hello @amministratore01pi,
This feature is not available in Custom Login Page Customizer, but you can use this code snippet in your theme’s functions.php file to achieve your goal:
function custom_login_redirect( $redirect_to, $request, $user ) { if ( isset( $user->roles ) && is_array( $user->roles ) ) {
// If the user is an administrator, allow them to go to the default admin dashboard
if ( in_array( 'administrator', $user->roles ) ) {
return admin_url();
} else {
// Redirect all other users to a specific page
return home_url( '/wp-admin/admin.php?page=wpbc-new' );
}
}
return $redirect_to;
}
add_filter( 'login_redirect', 'custom_login_redirect', 10, 3 );
This code will redirect all users to the URL specified except administrators. It will work if all other roles have access to this specific page that you mentioned.
Let me know if this works!