Programmically add multiple empty fields on a multiple value field/form In Drupal 7,  When you set a field "Number of values" to unlimited, it will show you 1 field on the creation page with an add more button.  How would one go about so it shows 5 empty fields on the creation page?
Have tested this in Drupal 8 but I think it is the same for drupal 7.

if($form_id == 'node_MYCONTENTTYPE_form') {
  $item = $form['FIELD_MY_FIELD_NAME']['widget'][0];
  for ($n=1; $n&lt;5; $n++) {
    if(!isset($form['FIELD_MY_FIELD_NAME']['widget'][$n])) {
      $form['FIELD_MY_FIELD_NAME']['widget'][$n] = $item;
    }
  }
}