You are here

function oa_core_panelizer_pre_render_alter in Open Atrium Core 7.2

Implements hook_panelizer_pre_render_alter().

File

./oa_core.module, line 1611

Code

function oa_core_panelizer_pre_render_alter(&$panelizer, $display, $entity) {

  // Hide comments when set to be hidden.
  // @see https://www.drupal.org/node/2505395
  if (module_exists('comment')) {
    if (isset($entity->comment) && $entity->comment == COMMENT_NODE_HIDDEN) {
      foreach ($panelizer->display->content as $key => $display) {
        if ($display->type == 'node_comment_wrapper') {
          unset($panelizer->display->content[$key]);
        }
      }
    }
  }
}