Custom roles and capabilities are added to the database. When the plugin is deactivated, these should be removed.
- [Instructor] Any time we add custom capabilities…to Roles in WordPress,…we are effectively changing the options table…in the database,…so just like with adding custom roles,…we need to make sure…that the custom capabilities are removed…once the plugin is deactivated.…That's done pretty much the same way…we added the capabilities in,…so I'm going to copy this entire function,…'taskbook_add_capabilities', and paste it in below,…then change it's name to 'remove_capabilities'.…
Then we don't have to run both of these loops here…because the task logger role…has already been removed in this scenario,…so the only thing we need to do is remove these capabilities…from administrator and editor.…So that means…I can get rid of this entire first section here.…And then inside the loop, instead of saying 'add_cap'…we're going to say 'remove_cap'.…
So when the function runs we find the administrator,…then go in and remove all these capabilities we just added,…and then we find the editor and do the same thing,…remove all the capabilities.…
- 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.