function DrupalMedia::isEnabled
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
- 
              core/
modules/ ckeditor/ src/ Plugin/ CKEditorPlugin/ DrupalMedia.php, line 113  
Class
- DrupalMedia
 - Defines the "drupalmedia" plugin.
 
Namespace
Drupal\ckeditor\Plugin\CKEditorPluginCode
public function isEnabled(Editor $editor) {
  if (!$editor->hasAssociatedFilterFormat()) {
    return FALSE;
  }
  // Automatically enable this plugin if the text format associated with this
  // text editor uses the media_embed filter.
  $filters = $editor->getFilterFormat()
    ->filters();
  return $filters->has('media_embed') && $filters->get('media_embed')->status;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.