function hook_editor_default_settings_alter

Modifies default settings for editor instances.

Modules that extend the behavior of other modules may use this hook to change the default settings provided to new and existing editors. This hook should be used when changing an existing setting to a new value. To add a new default setting, hook_editor_default_settings() should be used.

The return value of this hook is not cached. If retrieving defaults in a complex manner, the implementing module should provide its own caching inside the hook.

Parameters

$default_settings: The array of default settings which may be modified, passed by reference.

$editor: A string indicating the name of the editor library whose default settings are being provided.

Return value

array An array of default settings that will be merged into the editor defaults.

See also

hook_editor_default_settings()

Related topics

1 function implements hook_editor_default_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_default_settings_alter in drupal/core/modules/editor/tests/modules/editor_test.module
Implements hook_editor_default_settings_alter().
1 invocation of hook_editor_default_settings_alter()
Editor::__construct in drupal/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
Overrides Drupal\Core\Entity\Entity::__construct()

File

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

Code

function hook_editor_default_settings_alter(&$default_settings, $editor) {
  $default_settings['toolbar'] = array(
    'Bold',
    'Italics',
    'Underline',
  );
}