You are here

function stable_preprocess_links in Drupal 10

Same name and namespace in other branches
  1. 8 core/themes/stable/stable.theme \stable_preprocess_links()
  2. 9 core/themes/stable/stable.theme \stable_preprocess_links()

Implements template_preprocess_links().

File

core/themes/stable/stable.theme, line 29
Functions to support theming in the Stable theme.

Code

function stable_preprocess_links(&$variables) {
  if (!empty($variables['links'])) {
    foreach ($variables['links'] as $key => $value) {
      if (!is_numeric($key)) {
        $class = Html::getClass($key);
        $variables['links'][$key]['attributes']
          ->addClass($class);
      }
    }
  }
}