You are here

function searchindex_wipe_form_search_admin_settings_alter in Search Index Wipe 8

Same name and namespace in other branches
  1. 7 searchindex_wipe.module \searchindex_wipe_form_search_admin_settings_alter()

Implements hook_form_FORM_ID_alter().

File

./searchindex_wipe.module, line 15
Enables wipe of search index.

Code

function searchindex_wipe_form_search_admin_settings_alter(&$form, FormStateInterface $form_state) {
  if (\Drupal::currentUser()
    ->hasPermission('wipe search index')) {
    $form['status']['clear_index'] = array(
      '#value' => t('Wipe Index'),
      '#type' => 'submit',
      '#submit' => array(
        'searchindex_wipe_all',
      ),
      '#description' => t('Drops all the index build by search module'),
    );
  }
}