The WP REST API enables WordPress content and functionality to be used with AJAX, thus enabling code to be executed without a page refresh.
The workshop has a set of progressive code examples that you can work with and keep that culminate in an AJAX form that posts data to a custom WP REST API endpoint that we will have created, which also has WP-NONCE verification as well.
The workshop has minimal JavaScript and JSON knowledge which will be explained as needed.
In this workshop we will look at:
- What an API is and what makes it RESTful?
- How to get and display content using the built in WP REST API.
- How to create our own endpoints in the WP REST API for both GET and POST requests.
- How to create custom REST APIs using page-[slug].php
- Create some WP pages that GET content, search content and POST form data with the added security check of using WP-NONCES.
To make the most of this workshop it would be good to have a code editor, local web server or a code editor with ‘live-server’. Google’s POSTMAN can also be helpful, and we may look at this if time permits.
Suitable for intermediate developers and above.