Sunday, May 31, 2015

how to get Wordpress current user and user id?

$current_user = wp_get_current_user();
$current_user_name = $current_user->user_login ;

$user_id = get_current_user_id();

No comments:

Post a Comment

Please mention your comments.......