function Media::getElementsSubset

Same name and namespace in other branches
  1. 9 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Media.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Media::getElementsSubset()
  2. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Media.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Media::getElementsSubset()

Returns a configured subset of the elements supported by this plugin.

Return value

string[] An array of supported elements.

Overrides CKEditor5PluginElementsSubsetInterface::getElementsSubset

File

core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Media.php, line 195

Class

Media
CKEditor 5 Media plugin.

Namespace

Drupal\ckeditor5\Plugin\CKEditor5Plugin

Code

public function getElementsSubset() : array {
  $subset = $this->getPluginDefinition()
    ->getElements();
  $view_mode_override_enabled = $this->getConfiguration()['allow_view_mode_override'];
  if (!$view_mode_override_enabled) {
    $subset = array_diff($subset, [
      '<drupal-media data-view-mode>',
    ]);
  }
  return $subset;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.