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

Peter Westwood peter.westwood at ftwr.co.uk
Tue Sep 21 06:20:31 UTC 2010


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



More information about the wp-hackers mailing list