1 field_test.module field_test_field_available_languages_alter(&$languages, $context)

Implements hook_field_available_languages_alter().

File

core/modules/field/tests/field_test/field_test.module, line 104
Helper module for the Field API tests.

Code

function field_test_field_available_languages_alter(&$languages, $context) {
  if (state_get('field_test_field_available_languages_alter', FALSE)) {
    // Add an unavailable language.
    $languages[] = 'xx';
    // Remove an available language.
    $index = array_search('en', $languages);
    unset($languages[$index]);
  }
}