function CKEditorPluginManager::getButtons

Same name in other branches
  1. 8.9.x core/modules/ckeditor/src/CKEditorPluginManager.php \Drupal\ckeditor\CKEditorPluginManager::getButtons()

Retrieves all available CKEditor buttons, keyed by plugin ID.

Return value

array All available CKEditor buttons, with plugin IDs as keys and button metadata (as implemented by getButtons()) as values.

See also

\Drupal\ckeditor\CKEditorPluginButtonsInterface::getButtons()

File

core/modules/ckeditor/src/CKEditorPluginManager.php, line 141

Class

CKEditorPluginManager
Provides a CKEditor Plugin plugin manager.

Namespace

Drupal\ckeditor

Code

public function getButtons() {
    $plugins = array_keys($this->getDefinitions());
    $buttons_plugins = [];
    foreach ($plugins as $plugin_id) {
        $plugin = $this->createInstance($plugin_id);
        if ($plugin instanceof CKEditorPluginButtonsInterface) {
            $buttons_plugins[$plugin_id] = $plugin->getButtons();
        }
    }
    return $buttons_plugins;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.