php - Wordpress user id -


i have custom page submits form custom wordpress page. need check userid on page, :

 $user_id= get_current_user_id();    

when echo variable 0. however, if access page directly (without submitting form) shows correct userid.

to make stranger, when submit form admin bar disappear if wasn't logged in, again, if access page directly admin page appear.

what happening when submit form cause this?

i should mention page im submitting copy of page.php few lines of code submit variables database. have suggestions?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -