function TaxonomyTestHooks::formTaxonomyTermFormAlter

Implements hook_form_BASE_FORM_ID_alter() for the taxonomy term form.

File

core/modules/taxonomy/tests/modules/taxonomy_test/src/Hook/TaxonomyTestHooks.php, line 71

Class

TaxonomyTestHooks
Hook implementations for taxonomy_test.

Namespace

Drupal\taxonomy_test\Hook

Code

public function formTaxonomyTermFormAlter(&$form, FormStateInterface $form_state, $form_id) : void {
    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.