You are here

function hook_context_load_alter in Context 6.3

Same name and namespace in other branches
  1. 6 context.api.php \hook_context_load_alter()
  2. 7.3 context.api.php \hook_context_load_alter()

Alter a context directly after it has been loaded. Allows modules to alter a context object's reactions. While you may alter conditions, this will generally have no effect as conditions are cached for performance and contexts are loaded after conditions are checked, not before.

Parameters

&$context: The context object by reference.

1 invocation of hook_context_load_alter()
context_load in ./context.module
Context loader.

File

./context.api.php, line 97
Hooks provided by Context.

Code

function hook_context_load_alter(&$context) {
  if ($context->name === 'foo' && isset($context->reactions['block'])) {
    $context->reactions['block']['blocks']['locale-0'] = array(
      'module' => 'locale',
      'delta' => '0',
      'region' => 'header',
      'weight' => '2',
    );
  }
}