[wp-hackers] Will Activation Hook Be Executed During Plugin Upgradation?

Dougal Campbell dougal at gunters.org
Mon Sep 20 20:21:11 UTC 2010

  On Sep 20 2010 4:11 PM, scribu wrote:
> On Mon, Sep 20, 2010 at 8:29 PM, Peter Westwood
> <peter.westwood at ftwr.co.uk>wrote:
>> Actually, I would only expect activation hooks to fire when the plugin is
>> activated and not on upgrade.
>> Just like deactivation hooks should only fire on deactivation.
>> So the bug would be them firing at any point apart from real activation.
> That makes sense, although I (along with a lot of other plugin authors I
> imagine) overload the activation hook with procedures meant to be done when
> the plugin is updated.
> I think we should introduce a register_update_hook().

I was thinking along the lines of:

   do_action( 'update_plugin_' . $slug );
   do_action( 'update_theme_' . $slug );

...during the appropriate upgrade processes. But yeah, regardless of the 
actual implementation, an upgrade hook would be logical and good to have.

Dougal Campbell <dougal at gunters.org>

More information about the wp-hackers mailing list