[wp-hackers] Plugin register_activation_hook()

Ade Walker photofantaisie at gmail.com
Thu Dec 29 23:50:52 UTC 2011


2011/12/30 Dion Hulse (dd32) <wordpress at dd32.id.au>

>
> Hopefully your plugin isn't written in a way that it'll fatal if the
> options haven't been updated..
> Also, never perform the above checks on a non-admin page (which is why
> i've used the admin_init hook), doing so will lead to concurrency
> issues and much more likely that the upgrade routines will fire
> multiple times.
>
> See also:
> http://core.trac.wordpress.org/ticket/19681
> http://core.trac.wordpress.org/ticket/14912
>

Thanks, Dion.

Actually, the method you describe is exactly how I do it now, hooked to
admin_init. So, I won't change my methodology. :-)

No, in my case an option change wouldn't cause a fatal error, but I'm
thinking more about an undefined function fatal error, eg installing the
plugin on a lower WP version than required.


More information about the wp-hackers mailing list