Definition:
function get_currentuserinfo() {}
Populate global variables with information about the currently logged in user.
Will set the current user, if the current user is not set. The current user will be set to the logged in person. If no user is logged in, then it will set the current user to 0, which is invalid and won’t have any permissions.
Return values
returns:False on XMLRPC Request and invalid auth cookie. Null when current user set
Source code
function get_currentuserinfo() { global $current_user; if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) return false; if ( ! empty($current_user) ) return; 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); return false; } } wp_set_current_user($user); }
1340
No comments yet... Be the first to leave a reply!