You are here

function seven_preprocess_block in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/themes/seven/seven.theme \seven_preprocess_block()

Implements hook_preprocess_block() for block content.

Disables contextual links for all blocks.

File

core/themes/seven/seven.theme, line 90
Functions to support theming in the Seven theme.

Code

function seven_preprocess_block(&$variables) {
  if (isset($variables['title_suffix']['contextual_links'])) {
    unset($variables['title_suffix']['contextual_links']);
    unset($variables['elements']['#contextual_links']);
    $variables['attributes']['class'] = array_diff($variables['attributes']['class'], [
      'contextual-region',
    ]);
  }
}