[wp-hackers] Overriding Cor Functions (Was: IIS Problem)

Ryan Boren ryan at boren.nu
Mon Apr 4 03:34:12 GMT 2005


On Mon, 2005-04-04 at 00:30 +0200, Dan Thrue wrote:
> I think this a very good approach to have more control from
> plugins/modules whatever the should be called over core functions...
> 
> Similar your approach i have always wandered why there wasnt an
> "activate" and "deactivate" hook for plugins... I always do it
> manually :)

The attached patch introduces activate/deactivate hooks.  preload_file()
can be called from the activation hook.  Here's the usage:

function test_activate() {
	echo "activate<br/>";
}

function test_deactivate() {
	echo "deactivate<br/>";
}

register_activation_hook(__FILE__, 'test_activate');
register_deactivation_hook(__FILE__, 'test_deactivate');
?>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: activate_hook.diff
Type: text/x-patch
Size: 2254 bytes
Desc: not available
Url : http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050404/503b5071/activate_hook.bin


More information about the wp-hackers mailing list