function ClaroHooks::preprocessMenuLocalAction
Same name and namespace in other branches
- 11.x core/themes/claro/src/Hook/ClaroHooks.php \Drupal\claro\Hook\ClaroHooks::preprocessMenuLocalAction()
Implements hook_preprocess_HOOK() for menu-local-action templates.
Attributes
#[Hook('preprocess_menu_local_action')]
File
-
core/
themes/ claro/ src/ Hook/ ClaroHooks.php, line 229
Class
- ClaroHooks
- Hook implementations for claro.
Namespace
Drupal\claro\HookCode
public function preprocessMenuLocalAction(array &$variables) : void {
$variables['link']['#options']['attributes']['class'][] = 'button--primary';
$variables['attributes']['class'][] = 'local-actions__item';
$legacy_class_key = array_search('button-action', $variables['link']['#options']['attributes']['class']);
if ($legacy_class_key !== FALSE) {
$variables['link']['#options']['attributes']['class'][$legacy_class_key] = 'button--action';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.