function hook_webform_submission_render_alter in Webform 7.4
Same name and namespace in other branches
- 6.3 webform.api.php \hook_webform_submission_render_alter()
- 7.3 webform.api.php \hook_webform_submission_render_alter()
Alter the display of a Webform submission.
This function applies to both e-mails sent by Webform and normal display of submissions when viewing through the administrative interface.
Parameters
$renderable: The Webform submission in a renderable array, similar to FormAPI's structure. This variable must be passed in by-reference. Important properties of this array include #node, #submission, #email, and #format, which can be used to find the context of the submission that is being rendered.
Related topics
1 function implements hook_webform_submission_render_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
1 invocation of hook_webform_submission_render_alter()
- webform_submission_render in includes/
webform.submissions.inc - Prepare a Webform submission for display on a page or in an e-mail.
File
- ./
webform.api.php, line 268 - Sample hooks demonstrating usage in Webform.
Code
function hook_webform_submission_render_alter(&$renderable) {
// Remove page breaks from sent e-mails.
if (isset($renderable['#email'])) {
foreach (element_children($renderable) as $key) {
if ($renderable[$key]['#component']['type'] == 'pagebreak') {
unset($renderable[$key]);
}
}
}
}