You are here

function insert_form_alter in Insert 8

Same name and namespace in other branches
  1. 8.2 insert.module \insert_form_alter()

Implements hook_form_alter().

File

./insert.module, line 43

Code

function insert_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form_id === 'filter_format_edit_form') {
    $text_formats = \Drupal::config('insert.config')
      ->get('text_formats');
    if (in_array($form['format']['#default_value'], $text_formats)) {
      $form['filters']['settings']['filter_html']['allowed_html']['#element_validate'][] = 'insert_allowed_html_validate';
    }
  }
}