You are here

function _field_collection_table_sort_items_widget_helper in Field Collection Table 7

Comparison function for sorting field instances by their widget's weight.

1 string reference to '_field_collection_table_sort_items_widget_helper'
theme_field_collection_table_multiple_value_field in theme/theme.inc
Print a single row of multiple fields.

File

theme/theme.inc, line 42

Code

function _field_collection_table_sort_items_widget_helper($a, $b) {
  $a_weight = is_array($a) && isset($a['widget']['weight']) ? $a['widget']['weight'] : 0;
  $b_weight = is_array($b) && isset($b['widget']['weight']) ? $b['widget']['weight'] : 0;
  return $a_weight - $b_weight;
}