function taxonomy_test_form_taxonomy_term_form_alter

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module \taxonomy_test_form_taxonomy_term_form_alter()
  2. 8.9.x core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module \taxonomy_test_form_taxonomy_term_form_alter()
  3. 10 core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module \taxonomy_test_form_taxonomy_term_form_alter()

Implements hook_form_BASE_FORM_ID_alter() for the taxonomy term form.

File

core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module, line 44

Code

function taxonomy_test_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state, $form_id) {
    if (\Drupal::state()->get('taxonomy_test.disable_parent_form_element', FALSE)) {
        $form['relations']['parent']['#disabled'] = TRUE;
    }
}

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