You are here

function Editor::getMetadata in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/editor/src/Plugin/InPlaceEditor/Editor.php \Drupal\editor\Plugin\InPlaceEditor\Editor::getMetadata()

Generates metadata that is needed specifically for this editor.

Will only be called by \Drupal\quickedit\MetadataGeneratorInterface::generate() when the passed in field & item values will use this editor.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field values to be in-place edited.

Return value

array A keyed array with metadata. Each key should be prefixed with the plugin ID of the editor.

Overrides InPlaceEditorInterface::getMetadata

File

core/modules/editor/src/Plugin/InPlaceEditor/Editor.php, line 53
Contains \Drupal\editor\Plugin\InPlaceEditor\Editor.

Class

Editor
Defines the formatted text in-place editor.

Namespace

Drupal\editor\Plugin\InPlaceEditor

Code

function getMetadata(FieldItemListInterface $items) {
  $format_id = $items[0]->format;
  $metadata['format'] = $format_id;
  $metadata['formatHasTransformations'] = $this
    ->textFormatHasTransformationFilters($format_id);
  return $metadata;
}