A switch function is a great tool to customize behavior based on an input that has several different options. This video shows you how.
- [Instructor] Looking at this single task output right now…there is one field that immediately needs our attention,…and that is this one down here, the pre-task stress level.…It says three.…Now coming into this, you already know what three means,…neutral, but anyone else who uses this…will just see the number three…and think three out of what?…Three out of five, three out of 10, three out of 100,…is that good or bad, what's going on here.…In place of the number three,…we should really put in the actual value.…So we need to grab the number from both the…pre and the post task stress levels,…and convert them into human readable strings.…
Because we will need this twice,…we're going to create a separate function,…that just grabs the number…and converts it into a text string.…I'll do that inside loadsingle.ajax.js…right above the create task function.…Create a new function called get level.…Then we'll grab the object level,…and then inside this function…we'll set up a simple switch routine.…The switch takes object level,…
- 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.