function 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.

For more detailed information, see theme().

Parameters

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

96 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.

aggregator_preprocess_block in drupal/core/modules/aggregator/aggregator.module
Implements hook_preprocess_HOOK() for block.tpl.php.
bartik_preprocess_block in drupal/core/themes/bartik/template.php
Implements hook_preprocess_HOOK() for block.tpl.php.
bartik_preprocess_html in drupal/core/themes/bartik/template.php
Implements hook_preprocess_HOOK() for html.tpl.php.
bartik_preprocess_maintenance_page in drupal/core/themes/bartik/template.php
Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
book_preprocess_block in drupal/core/modules/book/book.module
Implements hook_preprocess_HOOK() for block.tpl.php.

... See full list

File

drupal/core/modules/system/theme.api.php, line 157

Code

function hook_preprocess_HOOK(&$variables) {

  // This example is from rdf_preprocess_image(). It adds an RDF attribute
  // to the image hook's variables.
  $variables['attributes']['typeof'] = array(
    'foaf:Image',
  );
}