function hook_esi_context_alter in ESI: Edge Side Includes 7.3
Allow other modules to alter the context setting.
Parameters
array $contexts: Array of context data as provided by hook_esi_context().
Object $account: A fully-loaded Drupal account.
See also
1 function implements hook_esi_context_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- esi_panels_esi_context_alter in modules/
esi_panels/ esi_panels.module - Implements hook_esi_context_alter().
1 invocation of hook_esi_context_alter()
- esi__get_user_contexts in ./
esi.module - Get the ESI contexts for a single user.
File
- ./
esi.api.inc, line 76 - API documentation for hooks defined by the ESI module.
Code
function hook_esi_context_alter($contexts, $account) {
// Change the 'GENDER' context so it's relevant to the location, in order to
// provide information appropriate to the local region as well as gender.
$region = my_module__get_region($account);
$contexts['GENDER'] = $region . ':' . $contexts['GENDER'];
}