WordPress: REST API

Author

Released

3/23/2017

Developers can interact remotely with a WordPress site from a client-side or external application by using the WordPress REST API. Using JSON objects, this API allows you to create and send content to a site, request information from a site, update existing content, and even create single page applications on top of WordPress. This course takes a detailed look at putting the WordPress REST API to use, demonstrating the use of routes, endpoints, arguments, requests, responses, and more. Technologies covered include RESTful APIs, JSON, HTML, CSS, JavaScript, PHP, and AJAX.

Topics include:

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

Setting up the core HTML, CSS, and JavaScript

Using AJAX to load subsequent responses

Skill Level Advanced

2h 6m

Duration

71,989

Views

Show MoreShow Less

- [Instructor] Hello and welcometo WordPress REST API Foundations.I'm Morten Rand-Hendriksenand I'll be your guide as we get acquaintedwith the WordPress REST API,previously referred to as the WP APIor the WordPress JSON API.The WordPress REST API is a core featureof WordPress providing a new method for developersto interact with WordPressto do new and exciting things.In the first part of this courseI'll explain what the WordPress REST APIand RESTFUL APIs are,how they work and why they matter.

Next, we'll look at how to interactwith the REST API and explore some of the many rootsand end points you can use to get data from WordPressin the JSON format.And then, we'll dive into some advanced code examplesto help you understand how to extendthe existing routes and end pointsto get the data you want,how to use the REST API in a regular WordPress themefor enhanced functionalityand finally, how to use the REST APIoutside WordPress to build a standalone applicationthat ingests REST API data from any WordPress site.

The WordPress REST API is changing what WordPress isand how we work with itand 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 crackingwith WordPress REST API Foundations.