From 43340fe7879d9ff762d49ad2ea29134eff3b74e4 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 5 Sep 2015 21:34:01 +0000 Subject: [PATCH] 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 --- src/wp-login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-login.php b/src/wp-login.php index 42a7cece63..9963a22e6a 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -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();