Commit 7fe1ece9 authored by webchick's avatar webchick

#717602 by heyrocker, jhodgdon: Document hook_batch_alter().

parent 1c054e4b
......@@ -3192,6 +3192,34 @@ function hook_token_info() {
);
}
/**
* Alter batch information before a batch is processed.
*
* Called by batch_process() to allow modules to alter a batch before it is
* processed.
*
* @param $batch
* The associative array of batch information. See batch_set() for details on
* what this could contain.
*
* @see batch_set()
* @see batch_process()
*
* @ingroup batch
*/
function hook_batch_alter(&$batch) {
// If the current page request is inside the overlay, add ?render=overlay to
// the success callback URL, so that it appears correctly within the overlay.
if (overlay_get_mode() == 'child') {
if (isset($batch['url_options']['query'])) {
$batch['url_options']['query']['render'] = 'overlay';
}
else {
$batch['url_options']['query'] = array('render' => 'overlay');
}
}
}
/**
* Alter the metadata about available placeholder tokens and token types.
*
......
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