Send an AJAX request to the WordPress REST API for the current task data.
- [Instructor] The code descendant AJAX request…to the REST API for a single task,…is pretty much identical to the code we used…to request a list of tasks.…The only difference is we pass along the current ID…for the task along with our general REST route.…And that's what we set up in the previous movie.…We have this new let taskRoute,…that contains that current ID.…That means all we have to do to send that AJAX request…is go to loadlist.ajax.js…where we already have this set up,…and just copy out the code here in its entirety.…
So this is the entire AJAX request.…Paste it in to loadsingle.ajax.js,…and then make a couple of tiny, tiny changes.…So here it says Run on AJAX REST request…with the help of JSO's jQuery wrapper,…that's correct.…The function is called getTaskList,…so I'm just going to change that name to getTask,…then the REST route here is going to be changed…because now we're going to use the taskRoute instead.…So I'll put that in here for the URL value.…
And then finally I need to call…this function, so getTask.…
- 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?
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.