function views_ui_pre_render_flatten_data

Flattens the structure of an element containing the #flatten property.

If a form element has #flatten = TRUE, then all of it's children get moved to the same level as the element itself. So $form['to_be_flattened'][$key] becomes $form[$key], and $form['to_be_flattened'] gets unset.

3 string references to 'views_ui_pre_render_flatten_data'
FilterPluginBase::buildExposeForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
Options form subform for exposed filter options.
FilterPluginBase::build_group_form in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
Build the form to let users create the group of exposed filters. This form is displayed when users click on button 'Build group'
SortPluginBase::buildExposeForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php
Form for exposed handler options.

File

drupal/core/modules/views/views_ui/admin.inc, line 367
Provides the Views' administrative interface.

Code

function views_ui_pre_render_flatten_data($form) {
  foreach (element_children($form) as $key) {
    $element = $form[$key];
    if (!empty($element['#flatten'])) {
      foreach (element_children($element) as $child_key) {
        $form[$child_key] = $form[$key][$child_key];
      }

      // All done, remove the now-empty parent.
      unset($form[$key]);
    }
  }
  return $form;
}