diff --git a/includes/form.inc b/includes/form.inc index 96d8e2d..8f35afe 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -156,8 +156,9 @@ function bootstrap_form_element_label(&$variables) { $t = get_t(); $is_checkbox = $element['#type'] == 'checkbox'; + $is_radio = $element['#type'] == 'radio'; // If title and required marker are both empty, output no label. - if ((!isset($element['#title']) || $element['#title'] === '' && $element['#type'] !== 'radio' && !$is_checkbox) && empty($element['#required'])) { + if ((!isset($element['#title']) || $element['#title'] === '' && !$is_radio && !$is_checkbox) && empty($element['#required'])) { return ''; } @@ -168,7 +169,7 @@ function bootstrap_form_element_label(&$variables) { $attributes = array(); // Style the label as class option to display inline with the element. - if ($element['#title_display'] == 'after' && !$is_checkbox) { + if ($element['#title_display'] == 'after' && !$is_radio && !$is_checkbox) { $attributes['class'][] = 'option'; $attributes['class'][] = $element['#type']; }