1 form_test.module form_test_form_user_register_form_alter(&$form, &$form_state)

Implements hook_form_FORM_ID_alter() for the registration form.

File

core/modules/simpletest/tests/form_test.module, line 2252
Helper module for the form API tests.

Code

function form_test_form_user_register_form_alter(&$form, &$form_state) {
  $form['test_rebuild'] = array(
    '#type' => 'submit',
    '#value' => t('Rebuild'),
    '#submit' => array('form_test_user_register_form_rebuild'),
  );
  // If requested, add the test field by attaching the node page form.
  if (!empty($_REQUEST['field'])) {
    $node = entity_create('node', array(
      'type' => 'page',
    ));
    field_attach_form('node', $node, $form, $form_state);
  }
}