Make WordPress Core


Ignore:
Timestamp:
05/11/2010 11:02:40 PM (15 years ago)
Author:
ryan
Message:

Setup user globals for user id 0. Props mdawaffe. fixes #13362

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r14321 r14573  
    519519        $user = new WP_User($for_user_id);
    520520
    521     if ( 0 == $user->ID )
     521    $userdata   = $user->data;
     522    $user_ID    = (int) $user->ID;
     523    $user_level = (int) isset($user->user_level) ? $user->user_level : 0;
     524
     525    if ( 0 == $user->ID ) {
     526        $user_login = $user_email = $user_url = $user_pass_md5 = $user_identity = '';
    522527        return;
    523 
    524     $userdata = $user->data;
     528    }
     529
    525530    $user_login = $user->user_login;
    526     $user_level = (int) isset($user->user_level) ? $user->user_level : 0;
    527     $user_ID = (int) $user->ID;
    528531    $user_email = $user->user_email;
    529532    $user_url   = $user->user_url;
Note: See TracChangeset for help on using the changeset viewer.