You are here

function hook_webform_submission_render_alter in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.api.php \hook_webform_submission_render_alter()
  2. 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 adminsitrative 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.

webform_webform_submission_render_alter in ./webform.module
Implements hook_webform_submission_render_alter().
1 invocation of hook_webform_submission_render_alter()
webform_submission_render in includes/webform.submissions.inc
Print a Webform submission for display on a page or in an e-mail.

File

./webform.api.php, line 207
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]);
      }
    }
  }
}