class Ckeditor5TestModuleAllowedImageHooks
Same name and namespace in other branches
- 11.x core/modules/ckeditor5/tests/modules/ckeditor5_test_module_allowed_image/src/Hook/Ckeditor5TestModuleAllowedImageHooks.php \Drupal\ckeditor5_test_module_allowed_image\Hook\Ckeditor5TestModuleAllowedImageHooks
Hook implementations for ckeditor5_test_module_allowed_image.
Hierarchy
- class \Drupal\ckeditor5_test_module_allowed_image\Hook\Ckeditor5TestModuleAllowedImageHooks
Expanded class hierarchy of Ckeditor5TestModuleAllowedImageHooks
File
-
core/
modules/ ckeditor5/ tests/ modules/ ckeditor5_test_module_allowed_image/ src/ Hook/ Ckeditor5TestModuleAllowedImageHooks.php, line 13
Namespace
Drupal\ckeditor5_test_module_allowed_image\HookView source
class Ckeditor5TestModuleAllowedImageHooks {
/**
* Implements hook_ckeditor5_plugin_info_alter().
*/
public function ckeditor5PluginInfoAlter(array &$plugin_definitions) : void {
// Add a custom file type to the image upload plugin. Note that 'svg+xml'
// below should be an IANA image media type Name, with the "image/" prefix
// omitted. In other words: a subtype of type image.
// @see https://www.iana.org/assignments/media-types/media-types.xhtml#image
// @see https://ckeditor.com/docs/ckeditor5/latest/api/module_image_imageconfig-ImageUploadConfig.html#member-types
$image_upload_plugin_definition = $plugin_definitions['ckeditor5_imageUpload']->toArray();
$image_upload_plugin_definition['ckeditor5']['config']['image']['upload']['types'][] = 'svg+xml';
$plugin_definitions['ckeditor5_imageUpload'] = new CKEditor5PluginDefinition($image_upload_plugin_definition);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| Ckeditor5TestModuleAllowedImageHooks::ckeditor5PluginInfoAlter | public | function | Implements hook_ckeditor5_plugin_info_alter(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.