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 Built from https://develop.svn.wordpress.org/trunk@33924 git-svn-id: http://core.svn.wordpress.org/trunk@33893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bdde0261bc
commit
3361f90a1c
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33923';
|
||||
$wp_version = '4.4-alpha-33924';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue