function edit_preprocess_field

Implements hook_preprocess_HOOK() for field.tpl.php.

File

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

Code

function edit_preprocess_field(&$variables) {
  $element = $variables['element'];
  $entity = $element['#object'];
  $variables['attributes']['data-edit-id'] = $entity
    ->entityType() . '/' . $entity
    ->id() . '/' . $element['#field_name'] . '/' . $element['#language'] . '/' . $element['#view_mode'];
}