Learn how to build a headless app—a standalone app that uses WordPress as a back end—using OAuth2, JavaScript, and the WordPress REST API.
Overview
Syllabus
Introduction
- Building a headless app with the WP REST API
- Prerequisites for this course
- Introduction to the Task Book app
- Content model for the application
- User flow for the application
- Create a functionality plugin
- Add custom post type for tasks
- Create new roles
- Create new capabilities
- Test the REST response
- Create a status field
- Set status field automatically
- Add CMB2 for custom meta boxes
- Create a custom meta box and fields
- Display REST fields using CMB2
- Install and configure the OAuth2 plugin
- Send authenticated requests to the REST API
- Restrict REST access based on roles
- Review of user flow
- JavaScript modules and structure
- Login by requesting a token
- Set up the authorization loop
- Set up the logout loop
- Request and display latest 10 tasks
- Request and display single tasks
- Send POST request on new/update task
- Display a chart based on task data
- Further information
Taught by
Morten Rand-Hendriksen