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

1
2
3
4
5
6
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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.