Join Morten Rand-Hendriksen for an in-depth discussion in this video A closer look at the API output of a post, part of WordPress REST API (WP-API): First Look (2015).
- Once you know how to get the API to return to you…the information you want, by using the routes and…the endpoints and whatever arguments and filters…you need, it's time to take a look at the actual…content that comes out.…And this is where working with the API…gets really interesting, because all the…content you need from the database,…will be provided to you by the API.…But sometimes, you may have to loop…through the content maybe three or four times…to get all the content you want.…So in this movie, I want to show you…what you get out of the Box if you request…a single post, to get you an idea and show…you where to get started.…
So I've submitted a GET request for…the post with the ID one, which is that…default post that all WordPress sites have.…It's an ideal post to showcase,…because it has very little content.…So if you look at the JSON return here,…you'll see that the content is divided into…Attribute-Value Pairs.…So we start out with ID, so this is the post ID,…and the ID is one.…Then we have the post date and time,…
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