function file_field_widget_info_alter in Drupal 9
Same name and namespace in other branches
- 8 core/modules/file/file.module \file_field_widget_info_alter()
Implements hook_field_widget_info_alter().
File
- core/
modules/ file/ file.module, line 70 - Defines a "managed_file" Form API field and a "file" field for Field module.
Code
function file_field_widget_info_alter(array &$info) {
// Allows using the 'uri' widget for the 'file_uri' field type, which uses it
// as the default widget.
// @see \Drupal\file\Plugin\Field\FieldType\FileUriItem
$info['uri']['field_types'][] = 'file_uri';
}