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

Prem Tiwari - - 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.

WordPress Custom Post Types

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:

Current Logged in User in WordPress

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 and also 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.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.