function _field_sort_items_helper

Callback for usort() within _field_sort_items().

Copied form element_sort(), which acts on #weight keys.

Related topics

1 string reference to '_field_sort_items_helper'
_field_sort_items in drupal/core/modules/field/field.module
Sorts items in a field according to user drag-and-drop reordering.

File

drupal/core/modules/field/field.module, line 552
Attach custom data fields to Drupal entities.

Code

function _field_sort_items_helper($a, $b) {
  $a_weight = is_array($a) ? $a['_weight'] : 0;
  $b_weight = is_array($b) ? $b['_weight'] : 0;
  return $a_weight - $b_weight;
}