[wp-trac] [WordPress Trac] #20372: WP_User::exists()
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 8 08:48:49 UTC 2012
#20372: WP_User::exists()
------------------------------+------------------
Reporter: markjaquith | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.4
Component: Users | Version:
Severity: normal | Resolution:
Keywords: has-patch commit |
------------------------------+------------------
Comment (by duck_):
Replying to [comment:6 nacin]:
> I looked at [3430] and wp_xmlrpc_server::login(). I feel like
get_currentuserinfo() should call wp_set_current_user(0) in the
XMLRPC_REQUEST branch. That would mean that wp_get_current_user() would
always return a WP_User object, which it does in literally every other
situation.
>
> If wp_get_current_user() returns a non-existent user before login() runs
in XML-RPC, I think that's just fine. $current_user should never be null
after calling get_currentuserinfo().
I was thinking along similar lines. Maybe even explicit
wp_set_current_user(0) in WP::init() so we can be sure that the
$current_user global is always a WP_User object.
Looking at the code it would require that get_currentuserinto() switches
to using the exists() method too.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20372#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list