You are here

function field_ui_form_field_ui_field_storage_add_form_alter in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field_ui/field_ui.module \field_ui_form_field_ui_field_storage_add_form_alter()
  2. 9 core/modules/field_ui/field_ui.module \field_ui_form_field_ui_field_storage_add_form_alter()

Implements hook_form_FORM_ID_alter() for 'field_ui_field_storage_add_form'.

File

core/modules/field_ui/field_ui.module, line 244
Allows administrators to attach custom fields to fieldable types.

Code

function field_ui_form_field_ui_field_storage_add_form_alter(array &$form) {
  $optgroup = (string) t('Reference');

  // Move the "Entity reference" option to the end of the list and rename it to
  // "Other".
  unset($form['add']['new_storage_type']['#options'][$optgroup]['entity_reference']);
  $form['add']['new_storage_type']['#options'][$optgroup]['entity_reference'] = t('Other…');
}