When reading an article online, I find it helpful to know when the article was last updated. Not all blogs display the last updated value however even when the last updated value is not displayed, the value is accessible via the WordPress REST API. This is how I retrieve the last modified value from the WordPress REST API.
REST API
Pretty Print JSON URL
I work a lot with JSON endpoints and having a browser extension to pretty print the JSON response is invaluable. However, sometimes I’m using a different machine (or guiding someone on their machine) and rather than asking them to install a browser extension, I use this trick. If the user is on the page displaying the JSON response, running this command in the browser console will pretty print the response await (await fetch(window.location.href)).json().
WordPress REST API call to Update Post Status Fails Silently
Recently, I was trying to update the post status of a post from ‘future’ to ‘publish’ publish` with the WordPress REST API and while the submission appeared to work, the value was not modified.
Test WordPress REST API Endpoints from the Browser with jQuery
You can make WordPress REST API calls from the browser console. Here is one way I work with WordPress REST API endpoints in the browser using jQuery.