[wp-hackers] Theme options in db: automatic deletion?
mikeschinkel at newclarity.net
Tue Nov 1 16:54:58 UTC 2011
On Nov 1, 2011, at 12:42 PM, Eric Mann wrote:
> Deletion versus deactivation.
> Deactivation shouldn't remove any options, settings, files, DB
> customizations, etc. I would also argue that *deletion* shouldn't, either.
> But if you absolutely have to place this kind of functionality in your
> theme/plugin, hooking in to the "Delete" click in the WordPress UI would be
> the safest. Still inadvisable, but safest ...
The BEST approach IMO would be upon plugin/theme deletion to serialize everything to a zipped archive file (or to a single option in the wp_options table) and then delete everything else persisted by the plugin/theme.
Upon activation the plugin/theme could then look to see if there are any archived settings and, if so, import them if the admin approves.
More information about the wp-hackers