All Drupal modules use hooks in the form of [modulename]_[hookname]() only actions turns this around. Why is that?
What would need to be considered when changing this to more default Drupal behaviour?

Comments

jvandyk’s picture

Status: Active » Closed (works as designed)

I presume that at sometime in the future, Drupal will have lots of actions. What would we need to collect this list of actions? We'd need a hook that maps actions to functions, then we'd need the action functions themselves.

Much faster and less code to simply extract all actions from the PHP symbol table. Any function that begins with action_ is automatically available. See actions_list().