Wedge

Public area => The Pub => Plugins => Topic started by: Dragooon on June 5th, 2012, 10:13 AM

Title: Optional hooks
Post by: Dragooon on June 5th, 2012, 10:13 AM
Currently if a hook isn't present the plugin is unable to install. Perhaps there should be a third stage where the hook is optional. This can be used to provide optional support to plugins if available, otherwise that functionality will be disabled but other parts of the plugin can continue to function.
Title: Re: Optional hooks
Post by: Arantor on June 5th, 2012, 12:40 PM
Way ahead of you, when you declare the hook, add the optional parameter:

Code: [Select]
<function point="hookname" function="myfunction" filename="$plugindir/File" optional="yes" />

Registers the hook but doesn't enforce it as being absolutely required.
Title: Re: Optional hooks
Post by: Dragooon on June 6th, 2012, 01:28 PM
Oh damn, missed that while reading the source. Thanks!