1 block_legacy.class.inc BlockLegacy::getTitle()

Return the title of a block as configured in the layout.

Return value

mixed:

Overrides Block::getTitle

File

core/modules/layout/includes/block_legacy.class.inc, line 32
Class that wraps around legacy hook_block_view/config/save() hooks.

Class

BlockLegacy
@file Class that wraps around legacy hook_block_view/config/save() hooks.

Code

function getTitle() {
  $title = parent::getTitle();

  // Use the default title if expected.
  if (empty($title) && $this->settings['title_display'] === LAYOUT_TITLE_DEFAULT) {
    $block_content = $this->buildBlock();
    if (isset($block_content['subject'])) {
      $title = $block_content['subject'];
    }
  }

  return $title;
}