Beispiel #1
0
 /**
  * @return WPLib_User_Base
  */
 function current_user()
 {
     /**
      * @var WP_User $user
      */
     $user = get_current_user();
     if (!isset($user->roles) || !is_array($user->roles) || 0 === count($user->roles)) {
         $user = null;
     } else {
         $user = WPLib::make_user($user);
     }
     return $user;
 }