form_process_weight

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 form_process_weight($element)

Expand weight elements into selects.

Related topics

Code

includes/form.inc, line 3786

<?php
function form_process_weight($element) {
  for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
    $weights[$n] = $n;
  }
  $element['#options'] = $weights;
  $element['#type'] = 'select';
  $element['#is_weight'] = TRUE;
  $element += element_info('select');
  return $element;
}
?>