You are here

function block_style_plugins_preprocess_block in Block Style Plugins 8

Same name and namespace in other branches
  1. 8.2 block_style_plugins.module \block_style_plugins_preprocess_block()

Implements hook_preprocess_block().

File

./block_style_plugins.module, line 48
Contains block_style_plugins.module.

Code

function block_style_plugins_preprocess_block(&$variables) {

  // Retrieve a list of style plugin definitions.

  /** @var Drupal\block_style_plugins\Plugin\BlockStyleManager $plugin_manager */
  $plugin_manager = \Drupal::service('plugin.manager.block_style.processor');
  $style_plugins = $plugin_manager
    ->getDefinitions();
  foreach ($style_plugins as $name => $plugin) {
    $variables = $plugin_manager
      ->createInstance($name)
      ->build($variables);
  }
}