wp_get_current_user() function not working in Rest API callback function
Logged in on your website doesn’t mean the user is authenticated in the REST API request, that’s why you are not getting the correct user or a Id = 0 Please take a look to the REST API authentication methods on the docs: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ For developers making manual Ajax requests, the nonce will need to … Read more