function _field_sort_items_value_helper

_field_sort_items_value_helper($a, $b)

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

Related topics

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.module/function/_field_sort_items_value_helper/7.x