Same name and namespace in other branches
  1. 8.9.x core/themes/claro/claro.theme \claro_form_views_exposed_form_alter()
  2. 9 core/themes/claro/claro.theme \claro_form_views_exposed_form_alter()

Implements hook_form_FORM_ID_alter() for views_exposed_form.

File

core/themes/claro/claro.theme, line 894
Functions to support theming in the Claro theme.

Code

function claro_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
  $view = $form_state
    ->getStorage()['view'];
  $view_title = $view
    ->getTitle();

  // Add a label so screen readers can identify the purpose of the exposed form
  // without having to scan content that appears further down the page.
  $form['#attributes']['aria-label'] = t('Filter the contents of the %view_title view', [
    '%view_title' => $view_title,
  ]);
}