You are here

function smart_title_form_alter in Smart Title 8

Implements hook_form_alter().

File

./smart_title.module, line 258
Contains hooks and private functions of smart_title.module.

Code

function smart_title_form_alter(&$form, FormStateInterface $form_state) {
  if ($form_state
    ->getFormObject() instanceof EntityFormInterface && $form_state
    ->getFormObject()
    ->getEntity() instanceof EntityViewDisplayInterface) {
    \Drupal::classResolver()
      ->getInstanceFromDefinition(EntityViewDisplayAlterer::class)
      ->addSmartTitle($form, $form_state);
  }
}