function language_entity_base_field_info_alter

language_entity_base_field_info_alter(&$fields)

Implements hook_entity_base_field_info_alter().

File

core/modules/language/language.module, line 167
Add language handling functionality to Drupal.

Code

function language_entity_base_field_info_alter(&$fields) {
  foreach ($fields as $definition) {
    // Set configurable form display for language fields with display options.
    if ($definition->getType() == 'language') {
      foreach (array('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);
        }
      }
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!language!language.module/function/language_entity_base_field_info_alter/8.1.x