Join Morten Rand-Hendriksen for an in-depth discussion in this video Register a Post Author Name field to the API response, part of WordPress REST API (WP-API): First Look.
- Now, I don't know about you,…but I think what we have so far…is pretty neat.…There's a button, you click on it.…Ajax kicks in and grabs stuff from the API,…and outputs it dynamically into the page.…And you can use it, and click on it,…and things actually work.…However, if you remember back to my demo…at the very beginning of this chapter,…it doesn't quite look the same as…the output we got from the live finish plugin.…Because I click on the link here you'll see…we have a loader, and then we get the title,…and the author name, and the featured image…if it's there.…
And we're missing the author name…and the featured image.…Now, there's a good reason for that.…If I go in and inspect this element here,…and go to my console, and look at the output,…you'll notice that although we have information…about the author, and that the author's ID is two,…we don't actually have the name of the author.…Likewise, we know there's a featured image,…it says featured image, and it has the featured image ID,…but we don't have a URL to the featured image.…
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