You are here

function ui_patterns_layout_builder_theme_registry_alter in UI Patterns Layout Builder 8

Implements hook_theme_registry_alter().

Add region_attributes to the pattern theme.

File

./ui_patterns_layout_builder.module, line 90
UI Patterns Layout Builder module file.

Code

function ui_patterns_layout_builder_theme_registry_alter(&$theme_registry) {
  foreach (UiPatterns::getManager()
    ->getPatterns() as $pattern) {
    $definition = $pattern
      ->getPluginDefinition();
    if (isset($theme_registry['pattern_' . $definition
      ->id()])) {
      $theme_registry['pattern_' . $definition
        ->id()]['variables']['region_attributes'] = [];
    }
  }
}