Created
April 30, 2017 13:58
-
-
Save alandbh/8e1c98782ca64ea3dc1521e0d01a5b23 to your computer and use it in GitHub Desktop.
Get user logged info. // Pega informações do usuário logado
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
/* Get user info. */ | |
global $current_user, $wp_roles; | |
//get_currentuserinfo(); //deprecated since 3.1 | |
$post_id = $_GET['post_id']; | |
$user_id = get_current_user_id(); | |
$current_user = wp_get_current_user(); | |
$avatarArr = get_field('avatar', 'user_'. $user_id ); //Using ACF | |
$avatarTbn = $avatarArr['sizes']['thumbnail']; | |
$user_email = $current_user->user_email; | |
$user_firstname = $current_user->user_firstname; | |
$display_name = $current_user->display_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment