I was thinking on how great it would be to hook into Garden right at the moment when an admin disables my plugin. My intention was to get some user interaction and depending on that interaction, decide if to purge or keep tables, for example.
So I went to GitHub and created a pull request to get a BeforeAddonDisabled event to achieve exactly that: make a hook an when admin disables my plugin, start my custom code. @Lincoln gave me a hint on a very, very useful function I could use to achieve exactly that: this great function is called OnDisable.
I have never been so happy that I haven't removed my newby title yet...
Comments
I hoped no one would ever mention that again...
I was thinking on how great it would be to hook into Garden right at the moment when an admin disables my plugin. My intention was to get some user interaction and depending on that interaction, decide if to purge or keep tables, for example.
So I went to GitHub and created a pull request to get a
BeforeAddonDisabled
event to achieve exactly that: make a hook an when admin disables my plugin, start my custom code. @Lincoln gave me a hint on a very, very useful function I could use to achieve exactly that: this great function is calledOnDisable
.I have never been so happy that I haven't removed my newby title yet...
me too. confused that is.
now I see what lincoln said
"You can add a method named "OnDisable" which already does this. It's the opposite of the Setup method."
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.