public function Wordcount::isEnabled in CKEditor Wordcount 8
Same name and namespace in other branches
- 2.x src/Plugin/CKEditorPlugin/Wordcount.php \Drupal\ckwordcount\Plugin\CKEditorPlugin\Wordcount::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
- src/
Plugin/ CKEditorPlugin/ Wordcount.php, line 45
Class
- Wordcount
- Defines the "wordcount" plugin.
Namespace
Drupal\ckwordcount\Plugin\CKEditorPluginCode
public function isEnabled(Editor $editor) {
$settings = $editor
->getSettings();
return isset($settings['plugins']['wordcount']) ? $settings['plugins']['wordcount']['enable'] : FALSE;
}