WordPress: get the current logged in user information

This is helpful during write the plugin or widget for wordpress:

user_login . "\n");
echo('User email: ' . $current_user->user_email . "\n");
echo('User level: ' . $current_user->user_level . "\n");
echo('User first name: ' . $current_user->user_firstname . "\n");
echo('User last name: ' . $current_user->user_lastname . "\n");
echo('User display name: ' . $current_user->display_name . "\n");
echo('User ID: ' . $current_user->ID . "\n");
?>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*