WordPress.org

Make WordPress Core

Ticket #14046: is_site_admin.diff

File is_site_admin.diff, 827 bytes (added by francescolaffi, 5 years ago)

make is_site_admin work, no changes to WP_User [ solution 2) in the first post]

  • wp-includes/ms-deprecated.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: /Users/Francesco/NetBeansProjects/wptrunk/trunk
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    4848                if ( !$user_id ) 
    4949                        return false; 
    5050        } else { 
    51                 $user = new WP_User( null, $user_login) ; 
    52                 if ( empty( $user->id ) ) 
     51                $user = get_userdatabylogin( $user_login ); 
     52                if ( empty( $user->ID ) ) 
    5353                        return false; 
    54                 $user_id = $user->id; 
     54                $user_id = $user->ID; 
    5555        } 
    5656 
    5757        return is_super_admin( $user_id );