[development] Convention for naming contrib hooks?

Ken Winters kwinters at coalmarch.com
Thu Oct 15 18:18:27 UTC 2009


On Oct 15, 2009, at 2:07 PM, Nancy Wichmann wrote:

> Larry Garfield wrote:
>> It's generally good practice to prefix a hook with the name of your
>> module if you're not a core module
>
> Gosh, it's kind of my thoughts that if it can't be found with
> module_invoke_all(), then it's not a "hook" (an API maybe). And
> module_invoke_all() won't find the function unless it starts with  
> the module
> name (core or contrib).
>


I believe they mean the actual hook name, rather than the  
implementation.  So,
the implementation should look something like this:

mymodule_cck_dosomething()

Where CCK defines the hook cck_dosomething() rather than just  
dosomething().

- Ken Winters



More information about the development mailing list