You are here

public function Wordcount::isEnabled in CKEditor Wordcount 2.x

Same name and namespace in other branches
  1. 8 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\CKEditorPlugin

Code

public function isEnabled(Editor $editor) {
  $settings = $editor
    ->getSettings();
  return isset($settings['plugins']['wordcount']) ? $settings['plugins']['wordcount']['enable'] : FALSE;
}