WordPress.org

Make WordPress Core

Ticket #21120: 21120.3.diff

File 21120.3.diff, 1.2 KB (added by nacin, 21 months ago)
  • wordpress/wp-includes/capabilities.php

     
    13811381 */ 
    13821382function is_super_admin( $user_id = false ) { 
    13831383        if ( $user_id ) 
    1384                 $user = new WP_User( $user_id ); 
     1384                $user = get_userdata( $user_id ); 
    13851385        else 
    13861386                $user = wp_get_current_user(); 
    13871387 
  • wordpress/wp-includes/pluggable.php

     
    114114 * 
    115115 * @since 0.71 
    116116 * 
    117  * @param int $user_id User ID 
     117 * @param int $user_id User ID. 
    118118 * @return bool|object False on failure, WP_User object on success 
    119119 */ 
    120120function get_userdata( $user_id ) { 
     
    133133 * @return bool|object False on failure, WP_User object on success 
    134134 */ 
    135135function get_user_by( $field, $value ) { 
     136        if ( 'id' === $field && $value && get_current_user_id() === $value ) 
     137                return wp_get_current_user(); 
     138 
    136139        $userdata = WP_User::get_data_by( $field, $value ); 
    137140 
    138141        if ( !$userdata )