How to Get the User Details of Current Logged in User in WordPress

| Last Updated: | In: WordPress, WordPress Snippets


Are you a WordPress developer or just started with WordPress, If your answer is yes, then keep bookmark this blog because you will always get the updates about WordPress and also you will get the tips & tricks of WordPress which help you a lot while you developing your next application using WordPress.

This si very short and quick tutorial, but it very useful tips of WordPress. In today tutorial, I will explain How to get the user details of current logged in user in WordPress.

How to Get the User details of Current Logged in User in WordPress

copy th below code and use in your php page or templates where you need. This will get the all the details of current logged in user from your WordPress site. Use the wp_get_current_user() this function will return the WP_User object. wp_get_current_user() function is located at wp-includes/pluggable.php file.

The output will look like:

If you have just started with WordPress, then check out:

By using the above function you can personalise your site experience for your users. Hope this tutorial help you, Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , ,