function FileHooks::fieldWidgetInfoAlter

Implements hook_field_widget_info_alter().

File

core/modules/file/src/Hook/FileHooks.php, line 69

Class

FileHooks
Hook implementations for file.

Namespace

Drupal\file\Hook

Code

public function fieldWidgetInfoAlter(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';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.