You are here

public function FieldMappingProcessor::processBlock in Gutenberg 8.2

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.

Parameters

array $block: The block object.

string $block_content: The inner block content.

\Drupal\Core\Cache\RefinableCacheableDependencyInterface $bubbleable_metadata: The bubbleable metadata.

Return value

bool|null Return FALSE if further processing should be stopped.

Overrides GutenbergBlockProcessorInterface::processBlock

File

src/BlockProcessor/FieldMappingProcessor.php, line 15

Class

FieldMappingProcessor
Processor removing blocks with a "mappingFields" attribute.

Namespace

Drupal\gutenberg\BlockProcessor

Code

public function processBlock(array &$block, &$block_content, RefinableCacheableDependencyInterface $bubbleable_metadata) {

  // Remove the inner content since the contents of this block will be mapped
  // to an entity field.
  $block_content = '';

  // Stop further processing by returning FALSE?
  // Shouldn't have to if it's of a low enough weight.
}