Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Render/theme.api.php \hook_preprocess_HOOK()
  2. 7.x modules/system/theme.api.php \hook_preprocess_HOOK()
  3. 8.9.x core/lib/Drupal/Core/Render/theme.api.php \hook_preprocess_HOOK()
  4. 9 core/lib/Drupal/Core/Render/theme.api.php \hook_preprocess_HOOK()

Preprocess theme variables for a specific theme hook.

This hook allows modules to preprocess theme variables for a specific theme hook. It should only be used if a module needs to override or add to the theme preprocessing for a theme hook it didn't define.

Note that, as all preprocess hooks, this hook is only invoked for theme hooks implemented as template files, but not those implemented as theme functions.

For more detailed information, see theme().

Parameters

$variables: The variables array (modify in place).

Related topics

38 functions implement hook_preprocess_HOOK()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

garland_preprocess_comment_wrapper in themes/garland/template.php
Add a "Comments" heading above comments except on forum pages.
phptemplate_preprocess_page in themes/garland/template.php
Override or insert PHPTemplate variables into the templates.
template_preprocess_aggregator_feed_source in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-feed-source.tpl.php.
template_preprocess_aggregator_item in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-item.tpl.php.
template_preprocess_aggregator_summary_item in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-summary-item.tpl.php.

... See full list

File

developer/hooks/core.php, line 2302
These are the hooks that are invoked by the Drupal core.

Code

function hook_preprocess_HOOK(&$variables) {
  $variables['drupal_major_version'] = '6.x';
}