Beispiel #1
0
 public static function getCurrentUser()
 {
     if (class_exists(InnThemeUser::class) && method_exists(InnThemeUser::class, 'getCurrentUser')) {
         InnThemeUser::getCurrentUser();
     }
     if (!static::isUserLoggedIn()) {
         return false;
     }
     static $cache = null;
     if ($cache === null) {
         $cache = \_wp_get_current_user();
     }
     return $cache;
 }
Beispiel #2
0
 /**
  * Retrieve the current user object.
  *
  * 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.
  *
  * @since 2.0.3
  *
  * @see _wp_get_current_user()
  * @global WP_User $current_user Checks if the current user is set.
  *
  * @return WP_User Current WP_User instance.
  */
 function wp_get_current_user()
 {
     return _wp_get_current_user();
 }
 /**
  * Populate global variables with information about the currently logged in user.
  *
  * @since 0.71
  * @deprecated 4.5.0 Use wp_get_current_user()
  * @see wp_get_current_user()
  *
  * @return bool|WP_User False on XMLRPC Request and invalid auth cookie, WP_User instance otherwise.
  */
 function get_currentuserinfo()
 {
     _deprecated_function(__FUNCTION__, '4.5.0', 'wp_get_current_user()');
     return _wp_get_current_user();
 }