When a user with no role logs in, redirect them to the home page rather than their profile screen which they do not have access to.

See #25162


git-svn-id: https://develop.svn.wordpress.org/trunk@33924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2015-09-05 21:34:01 +00:00
parent dd9722fac0
commit 43340fe787
1 changed files with 1 additions and 1 deletions

View File

@ -851,7 +851,7 @@ default:
elseif ( is_multisite() && !$user->has_cap('read') )
$redirect_to = get_dashboard_url( $user->ID );
elseif ( !$user->has_cap('edit_posts') )
$redirect_to = admin_url('profile.php');
$redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
}
wp_safe_redirect($redirect_to);
exit();