5 * Documentation for CKEditor module APIs.
8 use Drupal\editor\Entity\Editor;
16 * Modify the list of available CKEditor plugins.
18 * This hook may be used to modify plugin properties after they have been
19 * specified by other modules.
22 * An array of all the existing plugin definitions, passed by reference.
24 * @see \Drupal\ckeditor\CKEditorPluginManager
26 function hook_ckeditor_plugin_info_alter(array &$plugins) {
27 $plugins['someplugin']['label'] = t('Better name');
31 * Modify the list of CSS files that will be added to a CKEditor instance.
33 * Modules may use this hook to provide their own custom CSS file without
34 * providing a CKEditor plugin. This list of CSS files is only used in the
35 * iframe versions of CKEditor.
37 * Front-end themes (and base themes) can easily specify CSS files to be used in
38 * iframe instances of CKEditor through an entry in their .info.yml file:
41 * ckeditor_stylesheets:
42 * - css/ckeditor-iframe.css
46 * An array of CSS files, passed by reference. This is a flat list of file
47 * paths which can be either relative to the Drupal root or external URLs.
49 * The text editor object as returned by editor_load(), for which these files
50 * are being loaded. Based on this information, it is possible to load the
51 * corresponding text format object.
53 * @see _ckeditor_theme_css()
55 function hook_ckeditor_css_alter(array &$css, Editor $editor) {
56 $css[] = drupal_get_path('module', 'mymodule') . '/css/mymodule-ckeditor.css';
60 * @} End of "addtogroup hooks".