1 ckeditor5.api.php hook_ckeditor5_upgrade_button_mapping_alter(&$button_mapping)

Modify the button mapping used between CKEditor 4 and CKEditor 5 upgrades.

Parameters

array $button_mapping: An array of key-value pairs of strings, indicating CKEditor 4 to 5 button names. Modified by reference.

See also

ckeditor5_upgrade_format()

hook_ckeditor5_upgrade_button_mapping()

Related topics

File

core/modules/ckeditor5/ckeditor5.api.php, line 212
Documentation for CKEditor module APIs.

Code

function hook_ckeditor5_upgrade_button_mapping_alter(&$button_mapping) {
  // The key is the CKEditor 4 button name, while the value is the CKEditor 5
  // button name.
  $button_mapping['Maximize'] = 'maximize';

  // A value of NULL will remove the button during the upgrade process.
  $button_mapping['ShowBlocks'] = NULL;
}