Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LanguageHooks.php

function LanguageHooks::entityBaseFieldInfoAlter

Implements hook_entity_base_field_info_alter().

File

core/modules/language/src/Hook/LanguageHooks.php, line 192

Class

LanguageHooks
Hook implementations for language.

Namespace

Drupal\language\Hook

Code

public function entityBaseFieldInfoAlter(&$fields) : void {
    foreach ($fields as $definition) {
        // Set configurable form display for language fields with display options.
        if ($definition->getType() == 'language') {
            foreach ([
                'form',
                'view',
            ] as $type) {
                if ($definition->getDisplayOptions($type)) {
                    // The related configurations will be purged manually on Language
                    // module uninstallation. @see language_modules_uninstalled().
                    $definition->setDisplayConfigurable($type, TRUE);
                }
            }
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal