You are here

function field_test_field_available_languages_alter in Drupal 7

Implements hook_field_available_languages_alter().

1 string reference to 'field_test_field_available_languages_alter'
FieldTranslationsTestCase::testFieldAvailableLanguages in modules/field/tests/field.test
Ensures that only valid values are returned by field_available_languages().

File

modules/field/tests/field_test.module, line 104

Code

function field_test_field_available_languages_alter(&$languages, $context) {
  if (variable_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]);
  }
}