function ViewsHooks::formViewsExposedFormAlter

Implements hook_form_FORM_ID_alter() for the exposed form.

Since the exposed form is a GET form, we don't want it to send a wide variety of information.

File

core/modules/views/src/Hook/ViewsHooks.php, line 319

Class

ViewsHooks
Hook implementations for views.

Namespace

Drupal\views\Hook

Code

public function formViewsExposedFormAlter(&$form, FormStateInterface $form_state) : void {
    $form['form_build_id']['#access'] = FALSE;
    $form['form_token']['#access'] = FALSE;
    $form['form_id']['#access'] = FALSE;
}

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