This new hook_extension() functionality is now being used in 7.x since pending release 7.53 (currently in 7.x dev)

see comment
https://www.drupal.org/node/2825396#comment-11796418

hook_extension() in Drupal 7? o.O

Comments

joseph.olstad created an issue. See original summary.

David_Rothstein’s picture

Title: add hook_extension() documentation for 7.x like 8.x » Document theme engine "hooks" (like hook_extension() and hook_render_template()) for Drupal 7
Status: Needs work » Active

Just to clarify, this isn't a new hook - it's always been something that theme engines could implement if they needed to (even though core didn't implement it itself).

So I think we should actually document all the theme engine hooks in this issue? Which I believe are:
- hook_extension()
- hook_render_template()
- hook_init()

The first two can be backported from Drupal 8. The third is more complicated since it's a theme-engine-specific "hook" which shares a name with a regular Drupal core hook, but isn't the same thing. Also Drupal 8 doesn't seem to document that one. So maybe we can leave "hook_init" for a separate issue.

The hook_init() problem does make me wonder whether "hook" is even the right terminology for any of these. We have "callback" also (https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...) which I think is closer, although that's not exactly right either. We don't really have a good standard for how to document things for theme engines.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.