Not able to delete media by REST API
Not able to delete media by REST API
Not able to delete media by REST API
WP Rest Api GET method restriction on route, but POST method also works
The problem I was having is that I wasn’t receiving the full error object. To do that I changed the code to: const { username, password, email } = this.state; axios .post(`${Config.apiUrl}/wp/v2/users/register`, { username: username, password: password, email: email, }) .catch(err => { console.log({err}) }); Which then allowed me to figure out that the error … Read more
You’d only use the REST API or AJAX if you didn’t know what data you needed until the script was run or there was some user interaction. If you already know the data you need based on page you’re on then you might as just pass that data with wp_localize_script(), otherwise you’re forcing the client … Read more
Deleting media using the WordPress Rest API
REST API and Loopback error
You have to supply basic auth headers like below : curl -D- \ -X GET \ -H “Authorization: Basic xxxxyyyzzz” \ -H “Content-Type: application/json” \ “https://your-domain.com/rest/api/v1″ “xxxxyyyzzz” is the username:password base64 encoded
Thanks to Jacob Peattie, I was able to solve this issue. You have to include a nonce from the WordPress Javascript API in your REST API requests if you wish to use information about the current user. From the WordPress documentation: If no nonce is provided the API will set the current user to 0, … Read more
How to update a user with REST API v2 knowing only the username?
How to get WordPress Theme Customizer options in the REST API?