function DrupalMedia::isEnabled
Same name in other branches
- 9 core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalMedia.php \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia::isEnabled()
Overrides CKEditorPluginContextualInterface::isEnabled
File
-
core/
modules/ media/ src/ Plugin/ CKEditorPlugin/ DrupalMedia.php, line 109
Class
- DrupalMedia
- Defines the "drupalmedia" plugin.
Namespace
Drupal\media\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.