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

scribu mail at scribu.net
Mon Sep 27 20:31:47 UTC 2010


On Mon, Sep 27, 2010 at 10:02 PM, Andrew Nacin <wp at andrewnacin.com> wrote:

> On Mon, Sep 27, 2010 at 1:33 PM, Milan Dinić <liste at srpski.biz> wrote:
>
> > So until we get a solution for this in core, what do you recommend as a
> > lightweight solution, assuming that we have plugin version stored in
> > options?
>
>
> I run an upgrade routine on admin_init. Here's what I use:
> http://nacin.pastebin.com/CxAnByLM
>

Hopefully, in the next version, you will be able to replace
action_admin_init() with register_update_hook():

http://core.trac.wordpress.org/attachment/ticket/14912/plugin-versions.4.diff

You can basically use it now, if you copy it in your plugin and wrap it in
an if ( !function_exists(...) )


More information about the wp-hackers mailing list