[development] Convention for naming contrib hooks?

Nancy Wichmann nan_wich at bellsouth.net
Fri Oct 16 13:53:20 UTC 2009


Earnie Boyd wrote
>So I have a module foo implementing hook_foo_bar.  Module foo checks  
> for any implementation of hook_foo_bar by calling  
> module_invoke_all('foo_bar') in its foo_bar() function.

IMHO, that should be the standard practice. In all my modules, with the exception of Helpers, which acts as core extension (and I didn't intially write), that's the convention I follow.

It can look funny, though, if a module uses its own hook, which several of mine do. You can end up with "function foo_bar_foo_bar()".


Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



More information about the development mailing list