You are here

function _field_features_export_sort in Features 7

Same name and namespace in other branches
  1. 7.2 includes/features.field.inc \_field_features_export_sort()
1 call to _field_features_export_sort()
field_features_export_render in includes/features.field.inc
Implements hook_features_export_render().

File

includes/features.field.inc, line 133

Code

function _field_features_export_sort(&$field, $sort = TRUE) {

  // Some arrays are not sorted to preserve order (for example allowed_values).
  static $sort_blacklist = array(
    'allowed_values',
    'format_handlers',
  );
  if ($sort) {
    ksort($field);
  }
  foreach ($field as $k => $v) {
    if (is_array($v)) {
      _field_features_export_sort($field[$k], !in_array($k, $sort_blacklist));
    }
  }
}