Restore functionality of setup_userdata() when a user id is supplied. See #11271 and #11222.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-11-27 18:17:44 +00:00
parent 2a8e03ae14
commit 0c0bfbce3e
1 changed files with 4 additions and 4 deletions

View File

@ -448,15 +448,15 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
* @global string $user_pass_md5 MD5 of the user's password
* @global string $user_identity The display name of the user
*
* @param int $user_id Optional. User ID to setup global data.
* @param int $for_user_id Optional. User ID to setup global data.
*/
function setup_userdata($user_id = '') {
function setup_userdata($for_user_id = '') {
global $user_login, $userdata, $user_level, $user_id, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity;
if ( '' == $user_id )
if ( '' == $for_user_id )
$user = wp_get_current_user();
else
$user = new WP_User($user_id);
$user = new WP_User($for_user_id);
if ( 0 == $user->ID )
return;