Index: core.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/docs/developer/hooks/core.php,v
retrieving revision 1.218
diff -u -p -r1.218 core.php
--- core.php	5 Nov 2008 18:50:58 -0000	1.218
+++ core.php	9 Nov 2008 18:42:45 -0000
@@ -708,6 +708,39 @@ function hook_form_alter(&$form, $form_s
 }
 
 /**
+ * Provide a form-specific alteration instead of the global hook_form_alter().
+ *
+ * Modules can implement hook_form_FORM_ID_alter() to modify a specific form,
+ * rather than implementing hook_form_alter() and checking the form ID, or
+ * using long switch statements to alter multiple forms.
+ *
+ * Note that this hook fires before hook_form_alter(). Therefore all 
+ * implementations of hook_form_FORM_ID_alter() will run before all implementations
+ * of hook_form_alter(), regardless of the module order.
+ *
+ * @param $form
+ *   Nested array of form elements that comprise the form.
+ * @param $form_state
+ *   A keyed array containing the current state of the form.
+ * @return
+ *   None.
+ *
+ * @see drupal_prepare_form().
+ */
+function hook_form_FORM_ID_alter(&$form, &$form_state) {
+  // Modification for the form with the given form ID goes here. For example, if
+  // FORM_ID is "user_register" this code would run only on the user
+  // registration form.
+
+  // Add a checkbox to registration form about agreeing to terms of use.
+  $form['terms_of_use'] = array(
+    '#type' => 'checkbox',
+    '#title' => t("I agree with the website's terms and conditions."),
+    '#required' => TRUE,
+  );
+}
+
+/**
  * Map form_ids to builder functions.
  *
  * This hook allows modules to build multiple forms from a single form "factory"
