_field_multiple_value_form_sort_helper

_field_multiple_value_form_sort_helper($a, $b)

Callback for usort() within template_preprocess_field_multiple_value_form().

Sorts using ['_weight']['#value']

File

core/includes/theme.inc, line 1706
The theme system, which controls the output of Drupal.

Code

function _field_multiple_value_form_sort_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;
}
doc_Drupal
2016-10-29 09:57:12
Comments
Leave a Comment

Please login to continue.