You are here

function hook_panels_ipe_blocks_alter in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/panels_ipe.api.php \hook_panels_ipe_blocks_alter()

Modify the list of blocks available through the IPE interface.

Parameters

array $blocks: The blocks that are currently available.

\Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $panels_display: The current Panels display.

1 invocation of hook_panels_ipe_blocks_alter()
PanelsIPEPageController::getBlockPluginsData in panels_ipe/src/Controller/PanelsIPEPageController.php
Gets a list of Block Plugins from the server as data.

File

panels_ipe/panels_ipe.api.php, line 38
Hooks specific to the Panels IPE module.

Code

function hook_panels_ipe_blocks_alter(array &$blocks, PanelsDisplayVariant $panels_display) {

  // Only show blocks that were provided by the 'mymodule' module.
  foreach ($blocks as $key => $block) {
    if ($block['provider'] !== 'mymodule') {
      unset($blocks[$key]);
    }
  }
}