function edit_field_formatter_info_alter

Implements hook_field_formatter_info_alter().

Edit extends the @FieldFormatter annotation with the following keys:

  • edit: currently only contains one subkey 'editor' which indicates which in-place editor should be used. Possible values are 'form', 'direct' or 'disabled'.

File

drupal/core/modules/edit/edit.module, line 144
Provides in-place content editing functionality for fields.

Code

function edit_field_formatter_info_alter(&$info) {
  foreach ($info as $key => $settings) {

    // Set in-place editor to form if none is supplied.
    if (empty($settings['edit'])) {
      $info[$key]['edit'] = array(
        'editor' => 'form',
      );
    }
  }
}