
An overview of the course and what we set out to achieve using the WP REST API and AJAX forms.
Using ALL-IN-ONE migration plugin, I will show you how to clone in a replica of site if you have any difficutlites or are missing any files. You can also do the step by step process in the next lessons instead.
If you are having difficulty with latest 5.9 version I have added a second backup clone WP5.9-version.wpress with login: udemy59 and password: udemy59
We install the free Generatepress theme and create a child theme.
We load in the mu-plugins folder and custom php pages as well as create the menu bar.
In this lesson we add a custom MySQL table and also the ACF plugins to work with custom fields.
In this lesson we load in some dummy data from wptest.io and also a plugin called FakerPress.
We add a Chrome extension to format JSON data and we look at why we need the ACF TO REST plugin to be able to get ACF data in our REST API endpoints./
This is in the BONUS section but as we see some ARROW function of the new JS ES6, I thought I would include here again. I do cover the arrow function in the next lesson but this can help you be prepared. :)
In this lesson, we clarify what we mean by all these terms.
We look at the wp-json 'object' part of our REST API.
We look at some endpoints both built in to the REST API and ones we will be creating in this course.
We look at how to include custom fields in endpoints using the ACF to REST plugin.
We look at how to add additional fields to built in endpoints and it is our first look at adding code functionality in our project.
We use an HTML code example to demonstrate FETCH API, AJAX and DEV CONSOLE. It will be our first look at the WP REST API in detail and gives us the boiler plate code for AJAX GET requests.
We look at what a 404 error means in the FETCH API.
We look at CATH in the FETCH API for 500 errors.
e Following on from our work with our fetch html pages, we see how the same code snippet is used to create our three load buttons. This is effectively a SINGLE PAGE APPLICATION (SPA).
We use an inbuilt endpoint to search post title and content to get back a dataset of matching posts.
We create our first custom endpoint using the custom MySQL table we added in our site set up.
We create another endpoint that brings back the total user count. We also create an endpoint to get posts for a particular category.
We take a look at the POST form to see what the user we experience before diving in deeper in future lessons.
We look at the HTML and JS code for the front end form.
We look at the endpoint we are using and how we set up what parameters it expects and also how we make the parameters required and their validation rules if we so wish.
We continue the callback function. to look at the code for POST endpoints focusing on the callback function.
We look at how to create the WP nonce token and send it to the server either with the form or in the headers of the request.
We look at we can verify the nonce in the endpoint.
We look at how we can create global JS variables for use in our php pages that have JS in them and how to wire in JS variables with our PHP pages.
***** UPDATED and REVISED AUGUST 2020 *****
Based on feedback from students, this course has been revised and updated with some extra features so that you may quickly and effectively learn and use the REST API.
****************************************************
The WP REST API enables us to access data or post data via AJAX without refershing the page.
In this course, we will dive into the WP REST API endpoints, how to modify them, create our own CUTSOM WP REST API endpoints and use them in our pages and forms.
Packed with full code examples, you will be able to use the template pages straight away in your own site, as you will learn how to customise them for your site
***
In the first section we, will build the final site so that you can have your own working copy.
We then works STEP BY STEP through each part of the site so that you can UNDERSTAND how the REST API and AJAX work together.
This is taught in a developer to developer style. I am a developer and also a student learning all the latest technologies and I will treat you like a new developer that has joined our team.
We cover:
What the REST API is.
How to use built in WP REST APIs (endpoints).
How to add fields to built in endpoints.
How to create our own endpoints for GET requests.
How to create POST endpoints for forms.
How to create and use the WP Nonce security token and verify tokens.
How to us wp_localize_script to be able to pass PHP values to JavaScript code.
Welcome!
****