![](/img/trans.png)
[英]Wordpress cannot get_current_user_id() from ajax request
[英]How can I get the current user id in wordpress by making an ajax request from from the website's front end (built in react on the same domain)
我有一個 wordpress 網站,其中所有前端組件都使用 react。 我需要通過 ajax 請求使用 wordpress REST API 以某種方式獲取當前登錄用戶的 ID。 對 REST API 的請求需要經過身份驗證才能獲取此信息,但在沒有用戶憑據的情況下不確定如何獲取此信息。
提前致謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.