1 field_group.module field_group_pre_render(array &$element, $group, array &$form)

Pre render the field group element.

Parameters

array $element: Array of group element that needs to be created.

object $group: Object with the group information.

array $form: An associative array containing the structure of the form.

See also

field_group_fields_nest()

File

core/modules/field_group/field_group.module, line 1121
Field Group module.

Code

function field_group_pre_render(array &$element, $group, array &$form) {
  // Only run the pre_render function if the group has elements. All groups
  // have #array_parents & #field_parents set by field_group_fields_nest()
  // regardless of emptiness.
  if ($element == array() || !array_diff(array_keys($element), array(
      '#array_parents', '#field_parents',
    ))) {
    return;
  }

  // Let modules define their wrapping element.
  // Note that the group element has no properties, only elements.
  foreach (module_implements('field_group_pre_render') as $module) {
    $function = $module . '_field_group_pre_render';
    if (function_exists($function)) {
      // The intention here is to have the opportunity to alter the
      // elements, as defined in hook_field_group_formatter_info.
      // Note, implement $element by reference!
      $function($element, $group, $form);
    }
  }

  // Allow others to alter the pre_render.
  backdrop_alter('field_group_pre_render', $element, $group, $form);

}