Join Morten Rand-Hendriksen for an in-depth discussion in this video Start at the end: What we are building, part of WordPress REST API (WP-API): First Look (2015).
- To get a better understanding of how the WP API works…and how we can use it, we're going to build…a cool little plug-in that uses the API and some Ajax…to add useful information to posts…when visitors ask for it.…I've installed the finished plug-in on my live site…so that I can show you how it works.…So here you see we have a regular post,…and when I scroll to the bottom of the content of this post,…there's a big button here that says, "Get related posts."…When I click on this button, a request is passed to the API…to return the latest posts from the category or categories…the current post is filed under, and then limit that return…to only five posts.…
In the case of this post, I now got…one, two, three posts back,…and you can see that two of them have featured images,…and all of them returned the post title,…the post author and the post excerpt.…Each of these posts is wrapped inside a link,…so if I click anywhere on this box here,…I'm taken directly to that related post,…and when I scroll to the bottom of this post,…
With the WP API, developers can access the data on a WordPress site—such as users, posts, and categories—programmatically. The result is an expansion of the already limitless field of possibilities where theme and plugin development is concerned.
This course is a first look at the WP API: what it is, how to get it running, how to interact with it, what it can do for us, and what we can do with it. Join Morten Rand-Hendriksen, your guide and WordPress guru, as he walks through the tools and major features (such as routes and endpoints) of the WP API, as well as a short project that shows how this new API will be used in real-world workflows.
- Installing the WP API
- Exploring common routes
- Examining WP API output
- Building plugins with the WP API
- Crafting WP API URL requests
- Creating AJAX functions with the WP API