function claro_preprocess_datetime_wrapper

Same name in other branches
  1. 9 core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()
  2. 8.9.x core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()
  3. 11.x core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()

Implements template_preprocess_HOOK() for datetime_wrapper.

File

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

Code

function claro_preprocess_datetime_wrapper(&$variables) {
    if (!empty($variables['element']['#errors'])) {
        $variables['title_attributes']['class'][] = 'has-error';
    }
    if (!empty($variables['element']['#disabled'])) {
        $variables['title_attributes']['class'][] = 'is-disabled';
        if (!empty($variables['description_attributes'])) {
            $variables['description_attributes']->addClass('is-disabled');
        }
    }
}

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