diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 6d314b2f1a35a5ccb8a2ad2cd5a462a0971198ac..0d56a0a7d98733d8cfbe43967eda2ca0ba1ad616 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -630,7 +630,7 @@ function template_preprocess_field(&$variables, $hook) { // label, it needs to supply a preprocess function that sets it to the // sanitized element title or whatever else is wanted in its place. $variables['label_hidden'] = ($element['#label_display'] == 'hidden'); - $variables['label'] = $variables['label_hidden'] ? NULL : check_plain($element['#title']); + $variables['label'] = check_plain($element['#title']); // We want other preprocess functions and the theme implementation to have // fast access to the field item render arrays. The item render array keys diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index 4a56b7d29742c2863cb294528e9a57064c030faa..e3341256a3e9c1496597a53ad015de7c430a0bb3 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -178,10 +178,9 @@ function bartik_menu_tree__shortcut_default($variables) { function bartik_field__taxonomy_term_reference($variables) { $output = ''; - // Render the label, if it's not hidden. - if (!$variables['label_hidden']) { - $output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>'; - } + // Render the label either as a visible list or make it visually hidden for accessibility. + $hidden_class = empty($variables['label_hidden']) ? '' : ' visually-hidden'; + $output .= '<h3 class="field-label' . $hidden_class . '">' . $variables['label'] . ': </h3>'; // Render the items. $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">';