You are here

function paragraph_blocks_panels_ipe_blocks_alter in Paragraph blocks 8.2

Same name and namespace in other branches
  1. 8 paragraph_blocks.module \paragraph_blocks_panels_ipe_blocks_alter()
  2. 3.x paragraph_blocks.module \paragraph_blocks_panels_ipe_blocks_alter()

Implements hook_panels_ipe_blocks_alter().

File

./paragraph_blocks.module, line 56
Contains paragraph_blocks.module.

Code

function paragraph_blocks_panels_ipe_blocks_alter(&$blocks) {

  // Remove unused paragraphs and update the panels title from the paragraph.

  /** @var \Drupal\paragraph_blocks\ParagraphBlocksLabeller $labeller */
  $labeller = \Drupal::service('paragraph_blocks.labeller');
  $labeller
    ->hookPanelsIpeBlocksAlter($blocks);

  // Change the title of the "Content" block to "Full content".
  foreach ($blocks as $delta => $block) {
    if ($block['plugin_id'] == 'entity_field:node:field_content') {
      $blocks[$delta]['label'] = t('Full content');
      break;
    }
  }
}