Keep a plugin tidy
-
I’m sure that this has been answered before, but I cant seem to find the solution having searched here and on Google.
I want to know what hooks I can use for when a plugin is installed/deleted? This is different from activated and deactivated.
What I want to happen:
Installed: Nothing
Activated: Create database tables, add capability to role
Deactivated Remove capability from role
Activated: Add capability to role
Deactivated Remove capability from role
Deleted: Delete database tableBasically, I’d like the capability added and removed when the plugin is activated and deactivated, but I want the database table and contents persistent until the plugin is deleted. (I’m already using register_activation_hook() and register_deactivation_hook()).
Any help would be much appreciated. In the mean time I’ll look for a plugin that does this and take it apart ??
- The topic ‘Keep a plugin tidy’ is closed to new replies.