diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-28 12:36:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-28 12:36:26 +0000 |
commit | 19a45ce5446f1ebc87f98d294a3acffdc8b54478 (patch) | |
tree | 29182a43073943cc35a35aa4d68964a44e7eaa08 /modules/system/system.api.php | |
parent | 748c31038d0de19185c7c176731d7eed958b7c9d (diff) | |
download | brdo-19a45ce5446f1ebc87f98d294a3acffdc8b54478.tar.gz brdo-19a45ce5446f1ebc87f98d294a3acffdc8b54478.tar.bz2 |
- Patch #765860 by effulgentsia, dww, dereine, mikey_p, sun: make drupal_alter() support multiple alter hooks executed by module weight.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 4f4fb9935..a0fc4c0f4 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1241,7 +1241,11 @@ function hook_page_alter(&$page) { * altering a node form, the node object retrieved at from $form['#node']. * * Note that instead of hook_form_alter(), which is called for all forms, you - * can also use hook_form_FORM_ID_alter() to alter a specific form. + * can also use hook_form_FORM_ID_alter() to alter a specific form. For each + * module (in system weight order) the general form alter hook implementation + * is invoked first, then the form ID specific alter implementation is called. + * After all module hook implementations are invoked, the hook_form_alter() + * implementations from themes are invoked in the same manner. * * @param $form * Nested array of form elements that comprise the form. @@ -1250,6 +1254,8 @@ function hook_page_alter(&$page) { * @param $form_id * String representing the name of the form itself. Typically this is the * name of the function that generated the form. + * + * @see hook_form_FORM_ID_alter() */ function hook_form_alter(&$form, &$form_state, $form_id) { if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) { @@ -1269,15 +1275,12 @@ function hook_form_alter(&$form, &$form_state, $form_id) { * 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. * + * @see hook_form_alter() * @see drupal_prepare_form() */ function hook_form_FORM_ID_alter(&$form, &$form_state) { |