Learn how to add custom fields with GET and POST endpoints to the REST API using callbacks.
- [Instructor] The auto-generated task status…is now available from the database, and on the back…in the Wordpress, but if you go to the REST API…and send a request to a post that has a task status,…you'll quickly notice there is no task status field…available in the JSON response,…and that's simply because we have yet…to register the task status as a field in the REST API.…We can do this in status.php…by registering a new rest field.…
This is done by finding the REST API in this hook,…and then calling back a function…that registers a new rest field.…So, add action, we're looking for REST API in it,…which is when the REST API is initialized,…and here we call back a custom function…called taskbook register task status.…Then we have to set up that function.…
And inside this function, we register rest field.…Now, register rest field takes a series of arguments.…The first one is the post type we want…to register the rest field to, in this case, task.…The second one is the field name or label,…so in this case, this would be task status,…
- 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.