You are here

function taxonomy_test_form_taxonomy_term_form_alter in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module \taxonomy_test_form_taxonomy_term_form_alter()
  2. 9 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
Provides test hook implementations for taxonomy tests.

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;
  }
}