[wp-hackers] Setting default options for plugin

Jeremy Visser jeremy.visser at gmail.com
Tue Sep 4 01:01:01 GMT 2007


Peter Westwood wrote:
> On 3 Sep 2007, at 17:50, uberdose wrote:
>> I wouldn't use register_activation_hook() because it won't get
>> triggered on updates, and if people install in different directories
>> it's useless too.
> 
> If you use __FILE__ in your call to register_activation_hook then it
> will not matter what the folder name is.

> Maybe we need a register_update_hook which could be called when
> WordPress detects a version change in a plugin.

WordPress MU needs something similar. 'mu-plugins' never get their
activation/deactivation hooks called, because there is no concept of
activating or deactivating mu-plugins (you just add/delete the .php
files from the mu-plugins directory). All it does is run include() on
wp-content/mu-plugins/*.php.

Some plugins (particularly those that add DB tables) break with the lack
of these hooks, and I would like to see WordPress MU work differently in
that area.


More information about the wp-hackers mailing list