wp_get_current_user() returns 0 with sync in vibeBP

Home Forums Legacy Support Support queries Update Issues wp_get_current_user() returns 0 with sync in vibeBP

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #329191
    dorisamo
    Spectator
    Hello! I’m trying to get the login user id using wp_get_current_user(), but it returns 0. I enabled both syncs in vibeBP settings. When I login with admin, I can see 1 returned from wp_get_current_user(), but with other login ids (logging-in not in the admin), it only returns 0. Could you please help me? Thank you.
    #329326
    Anshuman Sahu
    Keymaster
    Well for that you will need to reload the page in order to detect the logged in user id as it needs the cookie to set , also in api calls you will not get the user id as api calls does not read cookies . To read the user in api calls you will need the token .
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘wp_get_current_user() returns 0 with sync in vibeBP’ is closed to new replies.