You are here

function _field_sort_items_value_helper in Drupal 7

Same as above, using ['_weight']['#value']

Related topics

2 string references to '_field_sort_items_value_helper'
theme_field_multiple_value_form in modules/field/field.form.inc
Returns HTML for an individual form element.
theme_file_widget_multiple in modules/file/file.field.inc
Returns HTML for a group of file upload widgets.

File

modules/field/field.module, line 549
Attach custom data fields to Drupal entities.

Code

function _field_sort_items_value_helper($a, $b) {
  $a_weight = is_array($a) && isset($a['_weight']['#value']) ? $a['_weight']['#value'] : 0;
  $b_weight = is_array($b) && isset($b['_weight']['#value']) ? $b['_weight']['#value'] : 0;
  return $a_weight - $b_weight;
}