function PreprocessHooks::menuLocalTaskViewsUi

Same name and namespace in other branches
  1. 11.x core/themes/admin/src/Hook/PreprocessHooks.php \Drupal\admin\Hook\PreprocessHooks::menuLocalTaskViewsUi()

Implements hook_preprocess_HOOK() for menu-local-task Views UI templates.

Attributes

#[Hook('preprocess_menu_local_task__views_ui')]

File

core/themes/admin/src/Hook/PreprocessHooks.php, line 928

Class

PreprocessHooks
Provides preprocess implementations.

Namespace

Drupal\admin\Hook

Code

public function menuLocalTaskViewsUi(array &$variables) : void {
  // Remove 'tabs__link' without adding a new class because it couldn't be
  // used reliably.
  // @see https://www.drupal.org/node/3051605
  $link_class_index = array_search('tabs__link', $variables['link']['#options']['attributes']['class'], TRUE);
  if ($link_class_index !== FALSE) {
    unset($variables['link']['#options']['attributes']['class'][$link_class_index]);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.