• How to get current loggined admin user id in domain pages? It’s getting 0 for admin.its getting fine in subdomain pages.

    • This topic was modified 4 years, 7 months ago by base123.
    • This topic was modified 4 years, 7 months ago by base123.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Depending on the context, it may not be possible. For example, sub-site code making an API request for main site content. The domains do not match, so no auth cookie is sent and the current user cannot be determined by the API handler. XML-RPC requests never have a user ID.

    Post the code you’re using and describe the context. Maybe someone will be able to check it out for you.

    Thread Starter base123

    (@base123)

    Hi,
    Issue:1
    When wp_get_current_user() is used for getting admin id, and loggined as admin getting ‘0’.also tried get_current_user_id().
    Issue 2:
    When loggined as super admin, and tried to get user ID using wp_current_user() and get_current_user_id() getting ‘0’. When getting emailid shows email(:protected). Com. Any other methods?

    Thread Starter base123

    (@base123)

    Hi,
    Can you give me an update of the attached issue .Please let me know if you require more time.Thank you for your attention.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting current loggined admin id’ is closed to new replies.