Opened 9 years ago
Closed 9 years ago
#33534 closed defect (bug) (invalid)
Activation hook doesn't get called with the new plugin update?
Reported by: | amonad | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Upgrade/Install | Keywords: | |
Focuses: | Cc: |
Description
With the new update mechanism, where the user can update the plugin from the plugin list screen itself. The activation hook doesn't seem to get triggered with this approach. Has this feature been deprecated because previously when the plugin was updated it used to follow these steps:
1) Deactivate plugin
2) Delete old plugin files
3) Install new plugin files
4) Activate the plugin.
I'm asking this because I need to add some new features in the new version of the plugin and that feature needs to save some default parameters in the db. I'm putting this code in the activation code which gets called when the plugin is activated. It's not working this way. Is there a new way I should handle such things in future?
Please help.
Since WordPress 3.1, this hook is fired only when the user activates the plugin and not when an automatic plugin update occurs. See #14915.
You need to manually detect plugin updates in your code. Quote from this announcement post: