Learn how to add an uninstall feature to your plugin. Using either Uninstall Hook or Uninstall File is a good idea because it enables your plugin to clean up after itself. In turn, this helps to keep databases clean and users happy.
- [Narrator] Good WordPress plugins…clean up after themselves so any options and temporary data…are removed from the database when the plugin is uninstalled…via the plugin screen.…Removing plugin-related data helps to keep the database tidy…and it's just good practice in general.…For example, here is the Theme Switcha plugin.…This plugin enables us to develop new themes privately.…To do so, it adds its options to the WordPress database.…Here in phpMyAdmin, we click on the WordPress database…and go to the options table…where we can find the plugin options with a quick search…and here we find the Theme Switcha option…stored in the options table.…
Now let's say that we're done…using the Theme Switcha plugin.…We deactivate and uninstall like usual.…Because Theme Switcha is a good plugin,…it cleans up after itself when it is uninstalled.…We can verify this by doing another quick search…and no results.…The plugin removed its options when it was uninstalled.…
Now we want to add the same functionality to our plugin…and that's what this video is all about.…
- WordPress APIs
- Action and filter hooks
- Activating and deactivating plugins
- Plugin security
- Creating the directory and files
- Adding menus and the settings page
- Inserting custom functionality
- Testing and debugging WordPress plugins
- Creating widgets
- Managing users and roles
- Adding custom post types and taxonomies
- Working with custom fields and database queries
- Using APIs: Transients, HTTP, and REST
Skill Level Intermediate
WordPress: Developing Secure Siteswith Jeff Starr2h 34m Intermediate
1. First Steps
2. Plugin Basics
3. Building a WordPress Plugin
4. Essential Plugin Techniques
5. Extending Plugin Functionality
6. Advanced Plugin Techniques
Next steps1m 16s
- 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.