You are here

function multiversion_element_pre_render in Multiversion 8

Element pre-render callback.

1 string reference to 'multiversion_element_pre_render'
multiversion_element_info_alter in ./multiversion.module
Implements hook_element_info_alter().

File

./multiversion.module, line 484

Code

function multiversion_element_pre_render($element) {
  if (isset($element['#cache'])) {
    if (!isset($element['#cache']['contexts'])) {
      $element['#cache']['contexts'] = [];
    }
    $element['#cache']['contexts'] = Cache::mergeContexts($element['#cache']['contexts'], [
      'workspace',
    ]);
  }
  return $element;
}