function ckeditor5_post_update_list_type_again

Same name and namespace in other branches
  1. main core/modules/ckeditor5/ckeditor5.post_update.php \ckeditor5_post_update_list_type_again()

Updates Text Editors using CKEditor 5 to native List "type" functionality.

File

core/modules/ckeditor5/ckeditor5.post_update.php, line 36

Code

function ckeditor5_post_update_list_type_again(array &$sandbox = []) : void {
  $config_entity_updater = \Drupal::classResolver(ConfigEntityUpdater::class);
  $config_entity_updater->update($sandbox, 'editor', function (Editor $editor) : bool {
    // Only try to update editors using CKEditor 5.
    if ($editor->getEditor() !== 'ckeditor5') {
      return FALSE;
    }
    $settings = $editor->getSettings();
    // @see Ckeditor5Hooks::editorPresave()
    return array_key_exists('ckeditor5_list', $settings['plugins']);
  });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.