With the readiness of the WP REST API still in question, developer Daniel Bachhuber yesterday announced the release of REST API Version 2.0 Beta 12, called Canyonero. You can download it from the plugin repository or GitHub. The most notable changes include removing meta endpoints from the primary plugin. “If your project depends on post meta endpoints, please install WP REST API Meta Endpoints,” Bachhuber wrote in the post. Other changes include returning original resource when deleting PTCU, moving to consistent use of context throughout controllers, and more. You can read the full list of changes here. The update comes on the heels of a contentious Slack […]
Basics Of AngularJS With The WordPress REST API
For the last few months, I’ve been writing extensively about two related, but seemingly contradictory points: the first is that learning a JavaScript MVC framework doesn’t equal learning JavaScript deeply. The second is that AngularJS is amazing — I love it and so should you. If you want to learn JavaScript deeply, take a course, read a book, and study the language. If you want to build something cool quickly learn Angular. But don’t skip learning the JavaScript basics. I think learning Angular is pretty easy, but that’s because I understand JavaScript fundamentals. If you’re new to JavaScript, then this article […]
REST API Infrastructure Officially Merged With Core
Earlier this week, the REST API team announced that it will be merged with core in 4.4, which is slated for release in a few months. The API comes in two parts, infrastructure and endpoints. You can rejoice that the infrastructure is part of core and that the endpoints will be available in the plugin. So what exactly does this mean? For one, everyone can build RESTful APIs much easier, and therefore, makes building custom APIs for your site a breeze. Plugin and theme developers can begin building right now. Start replacing any code you already have including admin-ajax endpoints. The only […]
REST API Custom Fields Revisited
I’ve covered adding custom fields to REST API responses before. While my original post from a few years ago is still largely valid, there are new improvements. I’d like to share what’s changed. When I wrote that post, the only way to add a custom field to a response was using register_rest_field and adding your own read, write and schema handlers. That method still works. But, you can also use register_meta(), which handles the callbacks for you. If your custom fields are stored using the WordPress object’s standard meta API, for example, user meta for users, then this new method […]
Developing a REST API App – Part 4: Creating Our React-Powered WordPress Site
In the last installment of our REST API App series, we started looking at the front end part of the puzzle and selected React as the solution we’d be running with. The reasons why were simple: it’s speedy, well-documented, and enjoys the support of one of the largest players in the business, Facebook. In order to check that we could get WordPress and React talking to each other, we downloaded the React Starter Kit locally and cobbled together a quick API call to display some arbitrary data from our local WordPress install. Though our test worked, we didn’t exactly go to […]
No Comments
Start the conversation