7.x theme.api.php hook_process_HOOK(&$variables)

Process theme variables for a specific theme hook.

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

For more detailed information, see theme().

Parameters

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

34 functions implement hook_process_HOOK()

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

aggregator_aggregator_process_info in modules/aggregator/aggregator.processor.inc
Implements hook_aggregator_process_info().
ajax_process_form in includes/ajax.inc
Form element processing handler for the #ajax form property.
bartik_process_html in themes/bartik/template.php
Override or insert variables into the page template for HTML output.
bartik_process_maintenance_page in themes/bartik/template.php
Override or insert variables into the maintenance page template.
bartik_process_page in themes/bartik/template.php
Override or insert variables into the page template.

... See full list

File

modules/system/theme.api.php, line 207

Code

function hook_process_HOOK(&$variables) {

  // @todo There are no use-cases in Drupal core for this hook. Find one from a
  //   contributed module, or come up with a good example. Coming up with a good
  //   example might be tough, since the intent is for nearly everything to be
  //   achievable via preprocess functions, and for process functions to only be
  //   used when requiring the later execution time.
}

Comments

sime’s picture

hook_process_HOOK runs after the equivalent hook_preprocess_HOOK and is intended to help with finalising changes introduced by the preprocess.

iMaze’s picture

Is there a hook for post processing? For example, I want some code to execute after a user logs in, but before the user is redirected after login.

Thanks

passionatevinay’s picture

function grayscale_process_html(&$vars) {
// Add classes for the font styles
$classes = explode(' ', $vars['classes']);
$classes[] = theme_get_setting('font_family');
$classes[] = theme_get_setting('font_size');
$vars['classes'] = trim(implode(' ', $classes));
}