WordPress.org

Make WordPress Core

Ticket #17829: 17829.diff

File 17829.diff, 1.3 KB (added by ryan, 7 years ago)
  • wp-login.php

     
    586586
    587587                if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
    588588                        // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
    589                         if ( is_multisite() && !get_active_blog_for_user($user->id) )
     589                        if ( is_multisite() && !get_active_blog_for_user($user->id) && !is_super_admin( $user->id ) )
    590590                                $redirect_to = user_admin_url();
    591591                        elseif ( is_multisite() && !$user->has_cap('read') )
    592592                                $redirect_to = get_dashboard_url( $user->id );
  • wp-includes/link-template.php

     
    23082308                $url = admin_url( $path, $scheme );
    23092309        } else {
    23102310                $current_blog = get_current_blog_id();
    2311                 if ( $current_blog  && in_array($current_blog, array_keys($blogs)) ) {
     2311                if ( $current_blog  && ( is_super_admin( $user_id ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
    23122312                        $url = admin_url( $path, $scheme );
    23132313                } else {
    23142314                        $active = get_active_blog_for_user( $user_id );