function hook_editor_js_settings_alter

Modifies JavaScript settings that are added for text editors.

Parameters

array $settings: All the settings that will be added to the page via drupal_add_js() for the text formats to which a user has access.

array $formats: The list of format objects for which settings are being added.

Related topics

1 function implements hook_editor_js_settings_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

editor_test_editor_js_settings_alter in drupal/core/modules/editor/tests/modules/editor_test.module
Implements hook_editor_js_settings_alter().
1 invocation of hook_editor_js_settings_alter()
EditorManager::getAttachments in drupal/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php
Retrieves text editor libraries and JavaScript settings.

File

drupal/core/modules/editor/editor.api.php, line 99
Documentation for Text Editor API.

Code

function hook_editor_js_settings_alter(array &$settings, array $formats) {
  if (isset($formats['basic_html'])) {
    $settings['basic_html']['editor'][] = 'MyDifferentEditor';
    $settings['basic_html']['editorSettings']['buttons'] = array(
      'strong',
      'italic',
      'underline',
    );
  }
}