get_currentuserinfo

Populate global variables with information about the currently logged in user.

Description

(bool|WP_User) get_currentuserinfo(); 

Returns (bool|WP_User)

False on XMLRPC Request and invalid auth cookie, WP_User instance otherwise.


Usage

  1. if ( !function_exists( 'get_currentuserinfo' ) ) { 
  2. require_once ABSPATH . WPINC . '/pluggable-deprecated.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_currentuserinfo(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/pluggable-deprecated.php  
  1. function get_currentuserinfo() { 
  2. _deprecated_function( __FUNCTION__, '4.5.0', 'wp_get_current_user()' ); 
  3.  
  4. return _wp_get_current_user();