1 field_ui.admin.inc field_ui_field_edit_instance_pre_render($element)

Render API callback: Merges instance, widget and other settings.

Combines the instance, widget, and other settings into a single fieldset so that elements within each group can be shown at different weights as if they all had the same parent.

This function is assigned as a #pre_render callback in field_ui_field_edit_form().


core/modules/field_ui/field_ui.admin.inc, line 2066
Administrative interface for custom field type creation.


function field_ui_field_edit_instance_pre_render($element) {
  // Merge the widget settings into the main form.
  if (isset($element['widget']['settings'])) {
    foreach (element_children($element['widget']['settings']) as $key) {
      $element['widget_' . $key] = $element['widget']['settings'][$key];

  // Merge the instance settings into the main form.
  if (isset($element['settings'])) {
    foreach (element_children($element['settings']) as $key) {
      $element['instance_' . $key] = $element['settings'][$key];

  return $element;