diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index d8b23d80f6..e633730020 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -74,11 +74,6 @@ if ( !function_exists('get_currentuserinfo') ) : function get_currentuserinfo() { global $current_user; - if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) { - wp_set_current_user( 0 ); - return false; - } - if ( ! empty( $current_user ) ) { if ( $current_user instanceof WP_User ) return; @@ -97,6 +92,11 @@ function get_currentuserinfo() { return false; } + if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) { + wp_set_current_user( 0 ); + return false; + } + if ( ! $user = wp_validate_auth_cookie() ) { if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[LOGGED_IN_COOKIE] ) || !$user = wp_validate_auth_cookie( $_COOKIE[LOGGED_IN_COOKIE], 'logged_in' ) ) { wp_set_current_user( 0 );