i18n_field_field_widget_properties_alter

  1. drupal
    1. 7 i18n_field.module function
Drupal 7 i18n_field_field_widget_properties_alter(&$widget, $context)

Implements hook_field_widget_properties_alter().

This is called for the entity edit form and for the fields edit form

File

sites/all/modules/i18n/i18n_field/i18n_field.module, line 187
Internationalization (i18n) module - Field handling

Code

function i18n_field_field_widget_properties_alter(&$widget, $context) {
  // Skip the node type edit fields by checking for existing entity
  if (!empty($context['entity']) && !empty($widget['module']) && function_exists($function = $widget['module'] . '_field_widget_form')) {
    $widget['module'] = 'i18n_field';
    $widget['i18n_field_callbacks'][] = $function;
  }
}