Setup user globals for user id 0. Props mdawaffe. fixes #13362
git-svn-id: http://svn.automattic.com/wordpress/trunk@14573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
27eda1fae6
commit
4437612d46
|
@ -518,13 +518,16 @@ function setup_userdata($for_user_id = '') {
|
||||||
else
|
else
|
||||||
$user = new WP_User($for_user_id);
|
$user = new WP_User($for_user_id);
|
||||||
|
|
||||||
if ( 0 == $user->ID )
|
|
||||||
return;
|
|
||||||
|
|
||||||
$userdata = $user->data;
|
$userdata = $user->data;
|
||||||
$user_login = $user->user_login;
|
|
||||||
$user_level = (int) isset($user->user_level) ? $user->user_level : 0;
|
|
||||||
$user_ID = (int) $user->ID;
|
$user_ID = (int) $user->ID;
|
||||||
|
$user_level = (int) isset($user->user_level) ? $user->user_level : 0;
|
||||||
|
|
||||||
|
if ( 0 == $user->ID ) {
|
||||||
|
$user_login = $user_email = $user_url = $user_pass_md5 = $user_identity = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$user_login = $user->user_login;
|
||||||
$user_email = $user->user_email;
|
$user_email = $user->user_email;
|
||||||
$user_url = $user->user_url;
|
$user_url = $user->user_url;
|
||||||
$user_pass_md5 = md5($user->user_pass);
|
$user_pass_md5 = md5($user->user_pass);
|
||||||
|
|
Loading…
Reference in New Issue