<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[21413] trunk: Move most instances of new WP_User to get_userdata().</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/21413">21413</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-08-03 01:06:05 +0000 (Fri, 03 Aug 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move most instances of new WP_User to get_userdata(). see <a href="http://core.trac.wordpress.org/ticket/21120">#21120</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpactivatephp">trunk/wp-activate.php</a></li>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludesclasswpuserslisttablephp">trunk/wp-admin/includes/class-wp-users-list-table.php</a></li>
<li><a href="#trunkwpadminincludesdeprecatedphp">trunk/wp-admin/includes/deprecated.php</a></li>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminincludesuserphp">trunk/wp-admin/includes/user.php</a></li>
<li><a href="#trunkwpadminnetworksiteusersphp">trunk/wp-admin/network/site-users.php</a></li>
<li><a href="#trunkwpadminnetworkusersphp">trunk/wp-admin/network/users.php</a></li>
<li><a href="#trunkwpadminusersphp">trunk/wp-admin/users.php</a></li>
<li><a href="#trunkwpincludescapabilitiesphp">trunk/wp-includes/capabilities.php</a></li>
<li><a href="#trunkwpincludescommentphp">trunk/wp-includes/comment.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwpincludespluggablephp">trunk/wp-includes/pluggable.php</a></li>
<li><a href="#trunkwpincludesuserphp">trunk/wp-includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpactivatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-activate.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-activate.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-activate.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         extract($result);
</span><span class="cx">                         $url = get_blogaddress_by_id( (int) $blog_id);
</span><del>-                        $user = new WP_User( (int) $user_id);
</del><ins>+                        $user = get_userdata( (int) $user_id);
</ins><span class="cx">                         ?>
</span><span class="cx">                         <h2><?php _e('Your account is now active!'); ?></h2>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -1018,7 +1018,7 @@
</span><span class="cx">                 ) );
</span><span class="cx">                 $x->send();
</span><span class="cx">         }
</span><del>-        $user_object = new WP_User( $user_id );
</del><ins>+        $user_object = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $wp_list_table = _get_list_table('WP_Users_List_Table');
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-users-list-table.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-users-list-table.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/class-wp-users-list-table.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                 global $wp_roles;
</span><span class="cx">
</span><span class="cx">                 if ( !( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) )
</span><del>-                        $user_object = new WP_User( (int) $user_object );
</del><ins>+                        $user_object = get_userdata( (int) $user_object );
</ins><span class="cx">                 $user_object->filter = 'display';
</span><span class="cx">                 $email = $user_object->user_email;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/deprecated.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/deprecated.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/deprecated.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -249,7 +249,8 @@
</span><span class="cx">
</span><span class="cx">         global $wpdb;
</span><span class="cx">
</span><del>-        $user = new WP_User( $user_id );
</del><ins>+        if ( ! $user = get_userdata( $user_id ) )
+                return array();
</ins><span class="cx">         $post_type_obj = get_post_type_object($post_type);
</span><span class="cx">
</span><span class="cx">         if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
</span></span></pre></div>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/ms.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -689,8 +689,8 @@
</span><span class="cx">         // Directly fetch site_admins instead of using get_super_admins()
</span><span class="cx">         $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
</span><span class="cx">
</span><del>-        $user = new WP_User( $user_id );
-        if ( ! in_array( $user->user_login, $super_admins ) ) {
</del><ins>+        $user = get_userdata( $user_id );
+        if ( $user && ! in_array( $user->user_login, $super_admins ) ) {
</ins><span class="cx">                 $super_admins[] = $user->user_login;
</span><span class="cx">                 update_site_option( 'site_admins' , $super_admins );
</span><span class="cx">                 do_action( 'granted_super_admin', $user_id );
</span><span class="lines">@@ -717,8 +717,8 @@
</span><span class="cx">         // Directly fetch site_admins instead of using get_super_admins()
</span><span class="cx">         $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
</span><span class="cx">
</span><del>-        $user = new WP_User( $user_id );
-        if ( $user->user_email != get_site_option( 'admin_email' ) ) {
</del><ins>+        $user = get_userdata( $user_id );
+        if ( $user && $user->user_email != get_site_option( 'admin_email' ) ) {
</ins><span class="cx">                 if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
</span><span class="cx">                         unset( $super_admins[$key] );
</span><span class="cx">                         update_site_option( 'site_admins', $super_admins );
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/upgrade.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx"> * @param string $password User's Password.
</span><span class="cx"> */
</span><span class="cx"> function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = new WP_User( $user_id );
</ins><span class="cx">         $email = $user->user_email;
</span><span class="cx">         $name = $user->user_login;
</span><span class="cx">         $message = sprintf(__("Your new WordPress site has been successfully set up at:
</span></span></pre></div>
<a id="trunkwpadminincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/user.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/user.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/includes/user.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> * @return object WP_User object with user data.
</span><span class="cx"> */
</span><span class="cx"> function get_user_to_edit( $user_id ) {
</span><del>-        $user = new WP_User( $user_id );
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $user->filter = 'edit';
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminnetworksiteusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/site-users.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/site-users.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/network/site-users.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">                                         if ( !is_user_member_of_blog( $user_id ) )
</span><span class="cx">                                                 wp_die(__('Cheatin&#8217; uh?'));
</span><span class="cx">
</span><del>-                                        $user = new WP_User( $user_id );
</del><ins>+                                        $user = get_userdata( $user_id );
</ins><span class="cx">                                         $user->set_role( $_REQUEST['new_role'] );
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span></span></pre></div>
<a id="trunkwpadminnetworkusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/users.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/users.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/network/users.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">
</span><span class="cx">         foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
</span><span class="cx">                 if ( $val != '' && $val != '0' ) {
</span><del>-                        $delete_user = new WP_User( $val );
</del><ins>+                        $delete_user = get_userdata( $val );
</ins><span class="cx">
</span><span class="cx">                         if ( ! current_user_can( 'delete_user', $delete_user->ID ) )
</span><span class="cx">                                 wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
</span><span class="lines">@@ -139,8 +139,8 @@
</span><span class="cx">                                                         break;
</span><span class="cx">
</span><span class="cx">                                                         case 'spam':
</span><del>-                                                                $user = new WP_User( $val );
-                                                                if ( in_array( $user->user_login, get_super_admins() ) )
</del><ins>+                                                                $user = get_userdata( $val );
+                                                                if ( is_super_admin( $user->ID ) )
</ins><span class="cx">                                                                         wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
</span><span class="cx">
</span><span class="cx">                                                                 $userfunction = 'all_spam';
</span></span></pre></div>
<a id="trunkwpadminusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/users.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/users.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-admin/users.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">                 if ( is_multisite() && !is_user_member_of_blog( $id ) )
</span><span class="cx">                         wp_die(__('Cheatin&#8217; uh?'));
</span><span class="cx">
</span><del>-                $user = new WP_User($id);
</del><ins>+                $user = get_userdata( $id );
</ins><span class="cx">                 $user->set_role($_REQUEST['new_role']);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">         $go_delete = 0;
</span><span class="cx">         foreach ( $userids as $id ) {
</span><span class="cx">                 $id = (int) $id;
</span><del>-                $user = new WP_User($id);
</del><ins>+                $user = get_userdata( $id );
</ins><span class="cx">                 if ( $id == $current_user->ID ) {
</span><span class="cx">                         echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n";
</span><span class="cx">                 } else {
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">         $go_remove = false;
</span><span class="cx">         foreach ( $userids as $id ) {
</span><span class="cx">                 $id = (int) $id;
</span><del>-                 $user = new WP_User($id);
</del><ins>+                 $user = get_userdata( $id );
</ins><span class="cx">                 if ( $id == $current_user->ID && !is_super_admin() ) {
</span><span class="cx">                         echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be removed.</strong>'), $id, $user->user_login) . "</li>\n";
</span><span class="cx">                 } elseif ( !current_user_can('remove_user', $id) ) {
</span></span></pre></div>
<a id="trunkwpincludescapabilitiesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/capabilities.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/capabilities.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/capabilities.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -1237,7 +1237,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         // Create new object to avoid stomping the global current_user.
</span><del>-        $user = new WP_User( $current_user->ID) ;
</del><ins>+        $user = new WP_User( $current_user->ID );
</ins><span class="cx">
</span><span class="cx">         // Set the blog id. @todo add blog id arg to WP_User constructor?
</span><span class="cx">         $user->for_blog( $blog_id );
</span><span class="lines">@@ -1261,9 +1261,9 @@
</span><span class="cx">         if ( !$post = get_post($post) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $author = new WP_User( $post->post_author );
</del><ins>+        $author = get_userdata( $post->post_author );
</ins><span class="cx">
</span><del>-        if ( empty( $author->ID ) )
</del><ins>+        if ( ! $author )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         $args = array_slice( func_get_args(), 2 );
</span><span class="lines">@@ -1283,7 +1283,7 @@
</span><span class="cx"> */
</span><span class="cx"> function user_can( $user, $capability ) {
</span><span class="cx">         if ( ! is_object( $user ) )
</span><del>-                $user = new WP_User( $user );
</del><ins>+                $user = get_userdata( $user );
</ins><span class="cx">
</span><span class="cx">         if ( ! $user || ! $user->exists() )
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkwpincludescommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/comment.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/comment.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/comment.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -650,13 +650,12 @@
</span><span class="cx">
</span><span class="cx">         do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
</span><span class="cx">
</span><del>-        if ( isset($user_id) && $user_id) {
-                $userdata = get_userdata($user_id);
-                $user = new WP_User($user_id);
</del><ins>+        if ( ! empty( $user_id ) ) {
+                $user = get_userdata( $user_id );
</ins><span class="cx">                 $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ( isset($userdata) && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
</del><ins>+        if ( $user && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
</ins><span class="cx">                 // The author and the admins get respect.
</span><span class="cx">                 $approved = 1;
</span><span class="cx">          } else {
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/link-template.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -1071,9 +1071,9 @@
</span><span class="cx">         if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
</span><span class="cx">                 return '';
</span><span class="cx">
</span><del>-        $user = new WP_User( $user_id );
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><del>-        if ( ! $user->exists() )
</del><ins>+        if ( ! $user )
</ins><span class="cx">                 return '';
</span><span class="cx">
</span><span class="cx">         if ( get_current_user_id() == $user->ID )
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/ms-functions.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -183,9 +183,9 @@
</span><span class="cx"> function add_user_to_blog( $blog_id, $user_id, $role ) {
</span><span class="cx">         switch_to_blog($blog_id);
</span><span class="cx">
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><del>-        if ( ! $user->exists() ) {
</del><ins>+        if ( ! $user ) {
</ins><span class="cx">                 restore_current_blog();
</span><span class="cx">                 return new WP_Error('user_does_not_exist', __('That user does not exist.'));
</span><span class="cx">         }
</span><span class="lines">@@ -246,8 +246,8 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // wp_revoke_user($user_id);
</span><del>-        $user = new WP_User($user_id);
-        if ( ! $user->exists() ) {
</del><ins>+        $user = get_userdata( $user_id );
+        if ( ! $user ) {
</ins><span class="cx">                 restore_current_blog();
</span><span class="cx">                 return new WP_Error('user_does_not_exist', __('That user does not exist.'));
</span><span class="cx">         }
</span><span class="lines">@@ -1056,7 +1056,7 @@
</span><span class="cx">         if ( is_email($email) == false )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $options_site_url = esc_url(network_admin_url('settings.php'));
</span><span class="cx">         $msg = sprintf(__('New User: %1s
</span><span class="lines">@@ -1233,7 +1233,7 @@
</span><span class="cx"> --The Team @ SITE_NAME' ) );
</span><span class="cx">
</span><span class="cx">         $url = get_blogaddress_by_id($blog_id);
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $welcome_email = str_replace( 'SITE_NAME', $current_site->site_name, $welcome_email );
</span><span class="cx">         $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );
</span><span class="lines">@@ -1282,7 +1282,7 @@
</span><span class="cx">
</span><span class="cx">         $welcome_email = get_site_option( 'welcome_user_email' );
</span><span class="cx">
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
</span><span class="cx">         $welcome_email = str_replace( 'SITE_NAME', $current_site->site_name, $welcome_email );
</span><span class="lines">@@ -1508,7 +1508,7 @@
</span><span class="cx"> */
</span><span class="cx"> function wpmu_log_new_registrations( $blog_id, $user_id ) {
</span><span class="cx">         global $wpdb;
</span><del>-        $user = new WP_User( (int) $user_id );
</del><ins>+        $user = get_userdata( (int) $user_id );
</ins><span class="cx">         $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1751,7 +1751,7 @@
</span><span class="cx">         } else {
</span><span class="cx">                 $user_id = get_user_id_from_string( $username );
</span><span class="cx">         }
</span><del>-        $u = new WP_User( $user_id );
</del><ins>+        $u = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         return ( isset( $u->spam ) && $u->spam == 1 );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludespluggablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pluggable.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pluggable.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/pluggable.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -1198,7 +1198,7 @@
</span><span class="cx"> * @param string $plaintext_pass Optional. The user's plaintext password
</span><span class="cx"> */
</span><span class="cx"> function wp_new_user_notification($user_id, $plaintext_pass = '') {
</span><del>-        $user = new WP_User($user_id);
</del><ins>+        $user = get_userdata( $user_id );
</ins><span class="cx">
</span><span class="cx">         $user_login = stripslashes($user->user_login);
</span><span class="cx">         $user_email = stripslashes($user->user_email);
</span></span></pre></div>
<a id="trunkwpincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/user.php (21412 => 21413)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/user.php        2012-08-02 22:17:06 UTC (rev 21412)
+++ trunk/wp-includes/user.php        2012-08-03 01:06:05 UTC (rev 21413)
</span><span class="lines">@@ -84,33 +84,32 @@
</span><span class="cx">                 return $error;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $userdata = get_user_by('login', $username);
</del><ins>+        $user = get_user_by('login', $username);
</ins><span class="cx">
</span><del>-        if ( !$userdata )
</del><ins>+        if ( !$user )
</ins><span class="cx">                 return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()));
</span><span class="cx">
</span><span class="cx">         if ( is_multisite() ) {
</span><span class="cx">                 // Is user marked as spam?
</span><del>-                if ( 1 == $userdata->spam)
</del><ins>+                if ( 1 == $user->spam)
</ins><span class="cx">                         return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
</span><span class="cx">
</span><span class="cx">                 // Is a user's blog marked as spam?
</span><del>-                if ( !is_super_admin( $userdata->ID ) && isset($userdata->primary_blog) ) {
-                        $details = get_blog_details( $userdata->primary_blog );
</del><ins>+                if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) {
+                        $details = get_blog_details( $user->primary_blog );
</ins><span class="cx">                         if ( is_object( $details ) && $details->spam == 1 )
</span><span class="cx">                                 return new WP_Error('blog_suspended', __('Site Suspended.'));
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
-        if ( is_wp_error($userdata) )
-                return $userdata;
</del><ins>+        $user = apply_filters('wp_authenticate_user', $user, $password);
+        if ( is_wp_error($user) )
+                return $user;
</ins><span class="cx">
</span><del>-        if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) )
</del><ins>+        if ( !wp_check_password($password, $user->user_pass, $user->ID) )
</ins><span class="cx">                 return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ),
</span><span class="cx">                 $username, wp_lostpassword_url() ) );
</span><span class="cx">
</span><del>-        $user = new WP_User($userdata->ID);
</del><span class="cx">         return $user;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -255,11 +254,9 @@
</span><span class="cx">                 _deprecated_argument( __FUNCTION__, '3.0' );
</span><span class="cx">
</span><span class="cx">         if ( empty( $user ) )
</span><del>-                $user = wp_get_current_user();
-        else
-                $user = new WP_User( $user );
</del><ins>+                $user = get_current_user_id();
</ins><span class="cx">
</span><del>-        if ( ! $user->exists() )
</del><ins>+        if ( ! $user = get_userdata( $user ) )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         if ( $user->has_prop( $wpdb->prefix . $option ) ) // Blog specific
</span><span class="lines">@@ -928,19 +925,19 @@
</span><span class="cx">         global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_identity;
</span><span class="cx">
</span><span class="cx">         if ( '' == $for_user_id )
</span><del>-                $user = wp_get_current_user();
-        else
-                $user = new WP_User($for_user_id);
</del><ins>+                $for_user_id = get_current_user_id();
+        $user = get_userdata( $for_user_id );
</ins><span class="cx">
</span><del>-        $userdata = null;
-        $user_ID = (int) $user->ID;
-        $user_level = (int) isset($user->user_level) ? $user->user_level : 0;
-
-        if ( ! $user->exists() ) {
</del><ins>+        if ( ! $user ) {
+                $user_ID = 0;
+                $user_level = 0;
+                $userdata = null;
</ins><span class="cx">                 $user_login = $user_email = $user_url = $user_identity = '';
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        $user_ID = (int) $user->ID;
+        $user_level = (int) $user->user_level;
</ins><span class="cx">         $userdata = $user;
</span><span class="cx">         $user_login = $user->user_login;
</span><span class="cx">         $user_email = $user->user_email;
</span></span></pre>
</div>
</div>
</body>
</html>