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

Milan Dinić liste at srpski.biz
Mon Sep 27 17:33:18 UTC 2010


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?

2010/9/21 Peter Westwood <peter.westwood at ftwr.co.uk>

>
> On 20 Sep 2010, at 23:05, scribu wrote:
>
> > Yeah, I guess checking a version stored in the db on each (admin) page
> load
> > is the most resilient way to go about it.
>
> Indeed it is.
>
> Realistically the only hooks we can safely provide are those for activation
> and deactivation.
>
> Updates can occur by a number of means not all of which are WordPress
> driven:
>  * Single plugin update
>  * Multiple plugin update
>  * Manual filesystem update - common for svn users
>  * Automated deployment script
>
> The simplest solution is to use an option to version your options just like
> WordPress uses one to version it's db schema.
>
> You can then run a function on an early hook to load/validate/upgrade the
> few options your plugin has.
>
> westi
> --
> Peter Westwood
> http://blog.ftwr.co.uk | http://westi.wordpress.com
> C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
>
> _______________________________________________
>  wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list