function claro_preprocess_select

Same name and namespace in other branches
  1. 8.9.x core/themes/claro/claro.theme \claro_preprocess_select()
  2. 10 core/themes/claro/claro.theme \claro_preprocess_select()
  3. 11.x core/themes/claro/claro.theme \claro_preprocess_select()

Implements template_preprocess_HOOK() for select.

File

core/themes/claro/claro.theme, line 849

Code

function claro_preprocess_select(&$variables) {
    if (!empty($variables['element']['#title_display']) && $variables['element']['#title_display'] === 'attribute' && !empty((string) $variables['element']['#title'])) {
        $variables['attributes']['title'] = (string) $variables['element']['#title'];
    }
    $variables['attributes']['class'][] = 'form-element';
    $variables['attributes']['class'][] = $variables['element']['#multiple'] ? 'form-element--type-select-multiple' : 'form-element--type-select';
    if (in_array('block-region-select', $variables['attributes']['class'])) {
        $variables['attributes']['class'][] = 'form-element--extrasmall';
    }
}

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