This file contains hidden or 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(); | |
| /** | |
| * @example Safe usage: $current_user = wp_get_current_user(); | |
| * if ( !($current_user instanceof WP_User) ) | |
| * return; | |
| */ | |
| echo 'Username: ' . $current_user->user_login . '<br />'; | |
| echo 'User email: ' . $current_user->user_email . '<br />'; | |
| echo 'User first name: ' . $current_user->user_firstname . '<br />'; |
NewerOlder