You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use get_current_user_id with wp_localize_script to output the data on the page. If you generate a nonce with wp_create_nonce then the user would be authenticated by passing in the X-WP-Nonce header and then you can use get_current_user_id in your WP_REST_Controller handler.
How do we go about getting the current user id? Do we need set a request header with X-WP-Nonce? Any examples would be awesome.
The text was updated successfully, but these errors were encountered: