• Resolved ottobonn28

    (@ottobonn28)


    Hi,

    I have been looking all over the web (including in the Codex) for the functions needed to install and uninstall a plugin. I know there is register_activation_hook and register_deactivation_hook, but what is I have a database table that needs to exist until the user totally deletes the plugin? I found two sites that talked about register_uninstall_hook, but this isn’t listed in the codex and so I don’t know if it is official. Is there any way to register a function to be called only when the plugin is totally deleted?

Viewing 4 replies - 1 through 4 (of 4 total)
  • This page gives some info, but I have not tried it myself:

    http://wpengineer.com/wordpress-plugin-deinstall-data-automatically/

    Thread Starter ottobonn28

    (@ottobonn28)

    Is it better to delete all of the plugin’s data every time it’s deactivated? That seems to be what the Codex suggests. It seems like that would be extremely frustrating to the user.

    I personally do not write my plugins to delete the data, simply because I think it is easier to have it remember the last settings. But then again, most of my plugins simply keep options in the database.

    If you have a plugin that is creating entirely new tables, or massive amounts of data in the DB, it might be more useful to delete them if the plugin is no longer needed.

    Thread Starter ottobonn28

    (@ottobonn28)

    Well I suppose it’s more a matter of personal preference then. Thanks for the link.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Plugin Install and Uninstall Hooks’ is closed to new replies.