Join Morten Rand-Hendriksen for an in-depth discussion in this video Add a loader graphic to the AJAX function, part of WordPress REST API (WP-API): First Look (2015).
- Here I want to take a little sidebar…and talk about user experience.…You see, anytime you add AJAX into…any kind of functionality on the site,…you have to keep in my mind that not everyone…is on a lightning fast connection on…the Internet all the time.…There are many different reasons why…it may take time for an AJAX request…to actually populate on the page.…And if the user is not notified that something's going on,…they may think something's wrong.…So let me give you an example of this.…I've opened up my page in the mobile view…and the developer tools in Chrome,…and I've set the network speed to 50 KB per second.…
That's really slow.…So if I now click on this button,…you'll see that it takes a good long time…before any content comes out.…And in all that time, the user will assume…something's wrong and keep hitting the button thinking…that something will happen.…Or they'll just turn everything off.…So we need to give the user a clear indication…that something is, in fact, happening,…so they don't keep clicking the button.…
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