Title: Identifying User in PHP
Last modified: April 5, 2017

---

# Identifying User in PHP

 *  Resolved [iant6](https://wordpress.org/support/users/iant6/)
 * (@iant6)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/identifying-user-in-php/)
 * Is it possible to identify a user who is logged into a secured area.
 * I want to restrict some data entry pages to a category of user, and it would 
   be helpful if each data entry session could automatically populate some fields
   related to identifying the user who is entering the data.
 * I am coding in PHP.
 * Thanks
    Ian

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/identifying-user-in-php/#post-9015238)
 * Could you explain your use case in more detail?
 * In WordPress, you can always get the current logged in user with `wp_get_current_user()`
   
   [https://developer.wordpress.org/reference/functions/wp_get_current_user/](https://developer.wordpress.org/reference/functions/wp_get_current_user/)
 * You can then use the API in Restrict User Access to find out what content the
   user has access to.
 *  Thread Starter [iant6](https://wordpress.org/support/users/iant6/)
 * (@iant6)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/identifying-user-in-php/#post-9020944)
 * Hi thanks for your reply – I have in the interim worked out a solution, as you
   have suggested, using wp_get_current_user().
    Regards
 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/identifying-user-in-php/#post-9046566)
 * That is great to hear!
 * If you have any more questions, do not hesitate to open a new support thread.
   And if you have time, please consider supporting me with a review here: [https://wordpress.org/support/plugin/restrict-user-access/reviews/](https://wordpress.org/support/plugin/restrict-user-access/reviews/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Identifying User in PHP’ is closed to new replies.

 * ![](https://ps.w.org/restrict-user-access/assets/icon-256x256.png?rev=1815922)
 * [Restrict User Access - Ultimate Membership & Content Protection](https://wordpress.org/plugins/restrict-user-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-user-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-user-access/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-user-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-user-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-user-access/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/identifying-user-in-php/#post-9046566)
 * Status: resolved