Package form data and send it to the WordPress REST API to create a new task.
- [Narrator] Sending information to the REST API…is almost identical to requesting information…from the REST API.…Really the only difference is we're changing the request…from a get request to a post request…and also sending some data along with our request.…The cool thing is,…we already kind of set this up previously in loadlist.ajax.…Here, we created the functionality…to get information from the REST API.…And now we can grab that same functionality…and reuse it by just changing a couple of key components.…
So here we have that functionality in loadlist.ajax.js.…So I'll copy out this entire AJAX call.…And I'll go into edittask.ajax.js…and create a new function called createTask.…And then I'll paste the code into that function.…Then we need to call the function createTask.…And we'll do that from generateJSON…after we've created formData.…So down here,…after formData's been created,…I'll say…createTask…and I'll pass along formData.…
Then up in createTask, we will receive formData.…Then we can make our AJAX request…
- Planning the application
- Extending WordPress with a plugin
- Setting up the standalone application
- Configuring OAuth 2 in WordPress
- Building the task list view
- Building the new task view
- Creating a new task via the REST API
- Displaying conditional content
- Visualizing data using Graph.js
Skill Level Advanced
1. Plan the Application
2. Extend WordPress with a Plugin
3. Set Up the Standalone Application
Review of user flow2m 34s
4. Build the Task List View
5. Build the New Task View
6. Build the Update/View Task View
7. Bonus Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.