theme.api.php needs updates now that hooks can be OO

Created on 25 June 2025, 10 days ago

Problem/Motivation

Found as part of 📌 Move preprocess functions into NodeThemeHooks Active

In theme.api.php we have things like:

Implementations of this hook must be placed in *.module or *.theme files

Along with many references to concrete implementations in core's modules (e.g node).

We should genericise these to make it obvious the documentation doesn't relate to specific implementations in core modules, but rather documents what you can do with the hooks.

Some examples:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... (why is static here?)

Proposed resolution

See docs for things like hook_theme_suggestions_HOOK

Remaining tasks

Figure out what to change
Potentially split into child issues

📌 Task
Status

Active

Version

11.0 🔥

Component

theme system

Created by

🇦🇺Australia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024