In Drupal 7, each core module has a *.api.php file, where * is the name of the module. for example
modules/node/node.api.php modules/path/path.api.php
What are these files for? They contain functions starting with hook_ , and the name of the hook that (I think) calls the module. for example
modules/system/system.api
It has
function hook_entity_view($entity, $type, $view_mode, $langcode) { $entity->content['my_additional_field'] = array( '#markup' => $additional_field, '#weight' => 10, '#theme' => 'mymodule_my_additional_field', ); }
There is an entity_view hook entity_view , which is called by a system that you can implement in your own modules, but (it does not appear) that hook_entity_view ever called.
What are these functions for? Are they ever called a system? If yes, then when? If not, why are they there?
Alan storm
source share