get_userdata should not ask for data when userid is 0 (why does it get called like that anyway?)
git-svn-id: http://svn.automattic.com/wordpress/trunk@1991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fd72d4e4d9
commit
21c073a733
|
@ -172,7 +172,7 @@ function get_currentuserinfo() { // a bit like get_userdata(), on steroids
|
|||
function get_userdata($userid) {
|
||||
global $wpdb, $cache_userdata;
|
||||
$userid = (int) $userid;
|
||||
if ( empty($cache_userdata[$userid]) ) {
|
||||
if ( empty($cache_userdata[$userid]) && $userid != 0) {
|
||||
$cache_userdata[$userid] =
|
||||
$wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID = '$userid'");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue