You are here

function _field_group_element_children_recursive_ref in Field Group 7

Recursive element_children, returns children by reference

1 call to _field_group_element_children_recursive_ref()
field_group_fields_nest in ./field_group.module
Recursive function to nest fields in the field groups.

File

./field_group.module, line 2122
Fieldgroup module.

Code

function _field_group_element_children_recursive_ref(&$element) {
  $results = array();
  $children = element_children($element);
  foreach ($children as $key) {
    $child =& $element[$key];
    if (is_array($child)) {
      $results[] =& $child;
      $results = array_merge($results, _field_group_element_children_recursive_ref($child));
    }
    unset($child);
  }
  return $results;
}