Commit 33695f71 authored by Dries's avatar Dries

- Patch #917670 by mr.baileys: improve drupal_alter() documentation.

parent fc283904
......@@ -832,7 +832,7 @@ function drupal_required_modules() {
* @endcode
*
* @param $type
* A string describing the data type of the alterable $data. 'form', 'links',
* 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
......@@ -840,13 +840,16 @@ function drupal_required_modules() {
* execute both hook_form_alter() and hook_form_FORM_ID_alter()
* implementations, it passes array('form', 'form_' . $form_id) for $type.
* @param &$data
* The primary data to be altered.
* The variable that will be passed to hook_TYPE_alter() implementations to be
* altered. The type of this variable depends on the value of the $type
* argument. For example, when altering a 'form', $data will be a structured
* array. When altering a 'profile', $data will be an object.
* @param &$context1
* (optional) An additional variable that is passed by reference.
* @param &$context2
* (optional) An additional variable that is passed by reference. If more
* context needs to be provided to implementations, then this should be an
* keyed array as described above.
* associative array as described above.
*/
function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
// Use the advanced drupal_static() pattern, since this is called very often.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment