wxt-8.x-3.011/modules/custom/wxt_ext/wxt_ext_editor/wxt_ext_editor.module
modules/custom/wxt_ext/wxt_ext_editor/wxt_ext_editor.module
<?php
/**
* @file
* Contains wxt_ext_editor.module.
*/
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_editor_js_settings_alter().
*/
function wxt_ext_editor_editor_js_settings_alter(array &$settings) {
foreach ($settings['editor']['formats'] as &$format) {
// Add a small ckeditor faux plugin.
if (isset($format['editor']) && $format['editor'] == 'ckeditor') {
$format['editorSettings']['drupalExternalPlugins']['wxt_ext_editor'] = base_path() . \Drupal::service('extension.list.module')->getPath('wxt_ext_editor') . '/js/wxt_ext_editor.js';
$format['editorSettings']['extraPlugins'] .= ',wxt_ext_editor';
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function wxt_ext_editor_form_editor_media_dialog_alter(array &$form, FormStateInterface $form_state) {
// Relabel existing field.
$form['caption']['#title'] = t('Figure');
$form['caption']['#description'] = t('Place this media item within a figure, with optional caption.');
}
