You are here

function hook_gutenberg_info_alter in Gutenberg 8.2

Perform alterations on gutenberg definitions.

Parameters

array $info: Array of information on gutenberg definitions exposed by gutenberg module/themes.

See also

\Drupal\gutenberg\GutenbergLibraryManager

1 invocation of hook_gutenberg_info_alter()
GutenbergLibraryManager::__construct in src/GutenbergLibraryManager.php
Constructs a new GutenbergManager object.

File

./gutenberg.api.php, line 79
Documentation for Gutenberg module APIs.

Code

function hook_gutenberg_info_alter(array &$info) {
  if (isset($info['example_block'])) {

    // Remove a specific example_block's front-end library definition.
    if (($key = array_search('example_block/block-view', $info['example_block']['libraries-view'], TRUE)) !== FALSE) {
      unset($info['example_block']['libraries-view'][$key]);
    }
  }
}