[development] Convention for naming contrib hooks?

Jennifer Hodgdon yahgrp at poplarware.com
Thu Oct 15 18:10:07 UTC 2009

Aaron Winborn wrote:
> I use hook_HOOKMODULE_HOOKNAME(), and see other modules doing that as 
> well, though I imagine there are some that use your suggestion as well; 
> your idea might be less likely to cause conflicts.

That is an excellent suggestion, but as has been noted in other 
replies, not all modules follow this suggestion. For instance, besides 
the FileField example in the original post in this thread, there was a 
problem with hook_diff() from the Diff module conflicting with an 
unrelated function named location_diff() in the Location module, about 
a year ago.

> I'm aware of at least two contrib API doxygen scraping sites out there: 
> http://drupalcontrib.org/ and http://api.lullabot.com/ (and probably 
> others).

Those sites will only help you find contrib hook documentation if the 
module developers have created API documentation headers/files for 
their hooks. Most do not bother.


Jennifer Hodgdon * Poplar ProductivityWare
Drupal, WordPress, and custom Web programming

More information about the development mailing list