You are here

function gin_lb_preprocess_form_element in Gin Layout Builder 1.0.x

Implements hook_preprocess_form_element().

File

./gin_lb.module, line 16
Provides hooks for gin_lb module.

Code

function gin_lb_preprocess_form_element(array &$variables) {
  if (!isset($variables['label'])) {
    return;
  }
  if (isset($variables['element']['#gin_lb_form'])) {
    $variables['label']['#gin_lb_form'] = TRUE;
    if (isset($variables['element']['#type'])) {
      $variables['attributes']['class'][] = 'form-type--' . $variables['element']['#type'];
    }
  }
}