You are here

interface GutenbergBlockProcessorInterface in Gutenberg 8.2

Defines an interface for classes that process Gutenberg blocks.

Hierarchy

Expanded class hierarchy of GutenbergBlockProcessorInterface

All classes that implement GutenbergBlockProcessorInterface

File

src/BlockProcessor/GutenbergBlockProcessorInterface.php, line 10

Namespace

Drupal\gutenberg\BlockProcessor
View source
interface GutenbergBlockProcessorInterface {

  /**
   * Process the Gutenberg block and its content.
   *
   * The content and block can be manipulated here. Return FALSE
   * to ensure that no other plugins are ran after this instance.
   *
   * @param array $block
   *   The block object.
   * @param string $block_content
   *   The inner block content.
   * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $bubbleable_metadata
   *   The bubbleable metadata.
   *
   * @return bool|null
   *   Return FALSE if further processing should be stopped.
   */
  public function processBlock(array &$block, &$block_content, RefinableCacheableDependencyInterface $bubbleable_metadata);

  /**
   * Whether the processor supports this block instance.
   *
   * @param array $block
   *   The block array.
   * @param string $block_content
   *   The inner block content.
   *
   * @return bool
   *   Whether the block is supported.
   */
  public function isSupported(array $block, $block_content = '');

}

Members

Namesort descending Modifiers Type Description Overrides
GutenbergBlockProcessorInterface::isSupported public function Whether the processor supports this block instance. 5
GutenbergBlockProcessorInterface::processBlock public function Process the Gutenberg block and its content. 5