Created
April 29, 2022 18:43
-
-
Save someguy9/7f82ed0a2d771fa8f155915aeab72bf7 to your computer and use it in GitHub Desktop.
Retrieve current logged in user's ID, Email, Name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$current_user = wp_get_current_user(); | |
echo 'Username: '.$current_user->user_login; | |
echo 'User ID: '.$current_user->ID; | |
echo 'User Email: '.$current_user->user_email; | |
echo 'User First Name: '.$current_user->user_firstname; | |
echo 'User Last Name: '.$current_user->user_lastname; | |
echo 'User Display Name: '.$current_user->display_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment