function form_test_form_user_register_form_alter

Implements hook_form_FORM_ID_alter() for the registration form.

File

drupal/core/modules/system/tests/modules/form_test/form_test.module, line 2235
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, $form, $form_state);
  }
}