function learn_press_get_user($user_id)
{
    if ($user_id) {
        return LP_User::get_user($user_id);
    }
    return LP_User_Guest::instance();
}
Esempio n. 2
0
/**
 * Get current user
 * @return LPR_User
 */
function learn_press_get_current_user()
{
    $user_id = get_current_user_id();
    $current_user = false;
    if ($user_id) {
        $current_user = learn_press_get_user($user_id);
    } else {
        $current_user = LP_User_Guest::instance();
    }
    return $current_user;
}