Explore how to use the WordPress REST API to interact remotely with your WordPress site so you can send content to your site, get info from it, update posts, and more. Learn how to use the API inside of WordPress, use the API outside of WordPress, modify responses, and more.
- [Instructor] Hello and welcome to WordPress REST API Foundations. I'm Morten Rand-Hendriksen and I'll be your guide as we get acquainted with the WordPress REST API, previously referred to as the WP API or the WordPress JSON API. The WordPress REST API is a core feature of WordPress providing a new method for developers to interact with WordPress to do new and exciting things. In the first part of this course I'll explain what the WordPress REST API and RESTFUL APIs are, how they work and why they matter.
Next, we'll look at how to interact with the REST API and explore some of the many roots and end points you can use to get data from WordPress in the JSON format. And then, we'll dive into some advanced code examples to help you understand how to extend the existing routes and end points to get the data you want, how to use the REST API in a regular WordPress theme for enhanced functionality and finally, how to use the REST API outside WordPress to build a standalone application that ingests REST API data from any WordPress site.
The WordPress REST API is changing what WordPress is and how we work with it and as a developer, this the time to get started working with it. I'm here to show you how to get started right, so let's get cracking with WordPress REST API Foundations.
- Using a REST client to communicate with a REST API
- Reviewing available routes, endpoints, and arguments
- Adding custom post types and taxonomies
- Altering the API response
- Using PHP for resiliency
- Passing info using wp_localize_script()
- Setting up a REST API request through AJAX
- Outputting selected post data to the front end
- Formatting post data to match a theme
- Triggering AJAX for an infinite scroll effect
- Using AJAX to load subsequent responses