[wp-hackers] Plugin uninstall/deactivate in 2.7 vs 2.6
DD32
wordpress at dd32.id.au
Sun Nov 2 01:44:17 GMT 2008
On Sun, 02 Nov 2008 10:09:32 +1100, A Walker <photofantaisie at live.fr>
wrote:
> In case I haven't explained myself very well (probably not, lol) the
> idea is to only register the deactivation hook if the plugin is
> installed on WP 2.6 and below.
>
> I'm scratching my head on this, and if anyone can point out where I've
> overlooked the obvious - please do! Thanks! :-)
If i'm understanding correctly, You're trying to work out how to only
register a deactivation hook for WP < 2.7? ie. to replace the uninstall
functionality?
If so i'd do this:
if ( function_exists('register_uninstall_hook') )
register_uninstall_hook('myplugin_uninstall');
else
register_deactivation_hook('myplugin_deactivate')
More information about the wp-hackers
mailing list