hook_editor_js_settings_alter

hook_editor_js_settings_alter(array &$settings)

Modifies JavaScript settings that are added for text editors.

Parameters

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

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

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

Code

function hook_editor_js_settings_alter(array &$settings) {
  if (isset($settings['editor']['formats']['basic_html'])) {
    $settings['editor']['formats']['basic_html']['editor'] = 'MyDifferentEditor';
    $settings['editor']['formats']['basic_html']['editorSettings']['buttons'] = array('strong', 'italic', 'underline');
  }
}
doc_Drupal
2016-10-29 09:17:54
Comments
Leave a Comment

Please login to continue.