Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.756.2.98 diff -u -r1.756.2.98 common.inc --- includes/common.inc 6 Sep 2010 11:13:27 -0000 1.756.2.98 +++ includes/common.inc 2 Nov 2010 17:04:12 -0000 @@ -2842,13 +2842,23 @@ * interface for all altering operations. * * @param $type - * The data type of the structured array. 'form', 'links', - * 'node_content', and so on are several examples. + * A string describing the type of the alterable $data. 'form', 'links', + * 'node_content', and so on are several examples. Alternatively can be an + * array, in which case hook_TYPE_alter() is invoked for each value in the + * array, ordered first by module, and then for each module, in the order of + * values in $type. For example, when Form API is using drupal_alter() to + * execute both hook_form_alter() and hook_form_FORM_ID_alter() + * implementations, it passes array('form', 'form_' . $form_id) for $type. * @param $data - * The structured array to be altered. + * The variable that will be passed to hook_TYPE_alter() implementations to + * be altered. The type of this variable depends on $type. For example, when + * altering a 'form', $data will be a structured array. When altering a + * 'profile', $data will be an object. Additional params that need to be + * passed by reference should be stored using an array with the key + * '__drupal_alter_by_ref'. * @param ... - * Any additional params will be passed on to the called - * hook_$type_alter functions. + * Any additional params, not passed by reference, will be passed on to the + * called hook_$type_alter functions. */ function drupal_alter($type, &$data) { // PHP's func_get_args() always returns copies of params, not references, so