function form_test_form_user_register_form_alter
7.x form_test.module | form_test_form_user_register_form_alter(&$form, &$form_state) |
Implements hook_form_FORM_ID_alter() for the registration form.
File
- drupal-7.x/
modules/ simpletest/ tests/ form_test.module, line 1736 - 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 = (object) array('type' => 'page');
field_attach_form('node', $node, $form, $form_state);
}
}