function TermTranslationHandler::entityFormAlter

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/TermTranslationHandler.php \Drupal\taxonomy\TermTranslationHandler::entityFormAlter()
  2. 8.9.x core/modules/taxonomy/src/TermTranslationHandler.php \Drupal\taxonomy\TermTranslationHandler::entityFormAlter()
  3. 10 core/modules/taxonomy/src/TermTranslationHandler.php \Drupal\taxonomy\TermTranslationHandler::entityFormAlter()

Overrides ContentTranslationHandler::entityFormAlter

File

core/modules/taxonomy/src/TermTranslationHandler.php, line 17

Class

TermTranslationHandler
Defines the translation handler for terms.

Namespace

Drupal\taxonomy

Code

public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
    parent::entityFormAlter($form, $form_state, $entity);
    $form['content_translation']['status']['#access'] = !isset($form['content_translation']);
    $form['actions']['submit']['#submit'][] = [
        $this,
        'entityFormSave',
    ];
}

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