Cache user id instead of full user object in the userlogins cache. Props charleshooper. fixes #3716
git-svn-id: http://svn.automattic.com/wordpress/trunk@4859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
36491e0980
commit
af10b7443f
|
@ -96,8 +96,7 @@ function get_userdata( $user_id ) {
|
|||
$user->user_description = $user->description;
|
||||
|
||||
wp_cache_add($user_id, $user, 'users');
|
||||
wp_cache_add($user->user_login, $user, 'userlogins');
|
||||
|
||||
wp_cache_add($user->user_login, $user_id, 'userlogins');
|
||||
return $user;
|
||||
}
|
||||
endif;
|
||||
|
@ -116,7 +115,9 @@ function get_userdatabylogin($user_login) {
|
|||
if ( empty( $user_login ) )
|
||||
return false;
|
||||
|
||||
$userdata = wp_cache_get($user_login, 'userlogins');
|
||||
$user_id = wp_cache_get($user_login, 'userlogins');
|
||||
$userdata = wp_cache_get($user_id, 'users');
|
||||
|
||||
if ( $userdata )
|
||||
return $userdata;
|
||||
|
||||
|
@ -147,8 +148,7 @@ function get_userdatabylogin($user_login) {
|
|||
$user->user_description = $user->description;
|
||||
|
||||
wp_cache_add($user->ID, $user, 'users');
|
||||
wp_cache_add($user->user_login, $user, 'userlogins');
|
||||
|
||||
wp_cache_add($user->user_login, $user->ID, 'userlogins');
|
||||
return $user;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
// This holds the version number in a separate file so we can bump it without cluttering the SVN
|
||||
|
||||
$wp_version = '2.2-bleeding';
|
||||
$wp_db_version = 4774;
|
||||
$wp_db_version = 4859;
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue