You are here

public function AutoEmbed::isEnabled in CKEditor Media Embed Plugin 8

Checks if this plugin should be enabled based on the editor configuration.

The editor's settings can be retrieved via $editor->getSettings().

Parameters

\Drupal\editor\Entity\Editor $editor: A configured text editor object.

Return value

bool

Overrides CKEditorPluginContextualInterface::isEnabled

File

src/Plugin/CKEditorPlugin/AutoEmbed.php, line 89

Class

AutoEmbed
Defines the "Auto Embed" plugin.

Namespace

Drupal\ckeditor_media_embed\Plugin\CKEditorPlugin

Code

public function isEnabled(Editor $editor) {
  $settings = $editor
    ->getSettings();
  return isset($settings['plugins']['autoembed']['status']) && (bool) $settings['plugins']['autoembed']['status'];
}