$user_info = elgg_get_logged_in_user_entity(); echo "Welcome back, " . $user_info->name . "!";
$user_info = wp_get_current_user(); echo "Welcome back, " . $user_info->user_login . "!";In this example, the user_info function is used with the WordPress platform to retrieve information about the currently logged in user. The code then greets the user by their username. Package/library: WordPress