Title: wp_get_current_user()-&gt;user_firstname not worked
Last modified: January 2, 2024

---

# wp_get_current_user()->user_firstname not worked

 *  Resolved [ritu31dodiya](https://wordpress.org/support/users/ritu31dodiya/)
 * (@ritu31dodiya)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wp_get_current_user-user_firstname-not-worked/)
 * I am currently using the `wp_get_current_user()->user_firstname` function in 
   my WordPress project to retrieve the first name of the logged-in user.. However,
   it seems that the function is not returning the any result.

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

 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wp_get_current_user-user_firstname-not-worked/#post-17312983)
 * Hi [@ritu31dodiya](https://wordpress.org/support/users/ritu31dodiya/),
 * It might be that the user object is not set or that the user is not logged in
   when the function is called.
 * To ensure the user is logged in, you can use `is_user_logged_in()` function before
   calling `wp_get_current_user()`.
 * If the issue persists, please make sure that the first name is actually set in
   the user’s profile.
 * We also recommend asking development questions on the #developers channel of 
   the [WooCommerce Community Slack](https://woo.com/community-slack/). Many of 
   our developers hang out there and will be able to offer insights into your question.
 * Let us know if this helps, or if you need further assistance!
 *  Thread Starter [ritu31dodiya](https://wordpress.org/support/users/ritu31dodiya/)
 * (@ritu31dodiya)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wp_get_current_user-user_firstname-not-worked/#post-17314561)
 * Thank you so much for your help!
 *  [ckadenge (woo-hc)](https://wordpress.org/support/users/ckadenge/)
 * (@ckadenge)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wp_get_current_user-user_firstname-not-worked/#post-17315081)
 * Hi again [@ritu31dodiya](https://wordpress.org/support/users/ritu31dodiya/),
 * Glad we were able to help! I will mark this thread as solved!
 * If you have a few minutes, we’d love if you could leave us a review: [https://wordpress.org/support/plugin/woocommerce/reviews/](https://wordpress.org/support/plugin/woocommerce/reviews/)
 * Cheers!

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

The topic ‘wp_get_current_user()->user_firstname not worked’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [ckadenge (woo-hc)](https://wordpress.org/support/users/ckadenge/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/wp_get_current_user-user_firstname-not-worked/#post-17315081)
 * Status: resolved