hook_field_info_alter

hook_field_info_alter(&$info)

Perform alterations on Field API field types.

Parameters

$info: Array of information on field types as collected by the "field type" plugin manager.

Related topics

Field Types API
Defines field, widget, display formatter, and storage types.
Hooks
Define functions that alter the behavior of Drupal core.

File

core/modules/field/field.api.php, line 54
Field API documentation.

Code

function hook_field_info_alter(&$info) {
  // Change the default widget for fields of type 'foo'.
  if (isset($info['foo'])) {
    $info['foo']['default widget'] = 'mymodule_widget';
  }
}
doc_Drupal
2016-10-29 09:18:09
Comments
Leave a Comment

Please login to continue.