How to change the view for a "Views: Filter by an entity reference view"-mode entity reference field on the node/add or edit form?
My code is wrong, now it works as below:

/**
 * Implements hook_form_alter().
 */
function sisucustom_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'registration_node_form') {
    global $user;
    $account = user_load($user-&gt;uid);
    if (isset($account-&gt;field_default_class['und'][0]['target_id'])) {
      $entity_node = node_load($account-&gt;field_default_class['und'][0]['target_id']);
      $options = array($entity_node-&gt;nid =&gt; $entity_node-&gt;title);
      $form['field_register_for_class'] = array(
        '#type' =&gt; 'select',
        '#options' =&gt; $options,
      );
    }
  }
}


Finally I searched out a thread answering my question about modifying the widget info here.