Make WordPress Core

Changeset 33924


Ignore:
Timestamp:
09/05/2015 09:34:01 PM (6 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r33774 r33924  
    852852                $redirect_to = get_dashboard_url( $user->ID );
    853853            elseif ( !$user->has_cap('edit_posts') )
    854                 $redirect_to = admin_url('profile.php');
     854                $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
    855855        }
    856856        wp_safe_redirect($redirect_to);
Note: See TracChangeset for help on using the changeset viewer.