Closed eugenchio closed 5 years ago
I don't think this is possible, you need to create a custom media library or use a third party!
@Qoraiche , Thanks for reply! Can you please advice me the way of attaching my custom library to the gutenberg-js?
Take a look at front/g-editor i think they already using a simple local media library you can start with it. (@SofiaSousa correct me if i'm wrong)
Hope this helps.
The original one opens the Wordpress Gallery window, that's why we did the override.
Now there is a filter (editor.MediaUpload
) to replace the component.
https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/hooks/components/index.js
Check filters docs here: https://github.com/WordPress/gutenberg/tree/master/docs/designers-developers/developers/filters
@eugenchio You need to use wp.hooks.addFilter() to add a "editor.MediaUpload" filter. For an example, check how it was done on Drupal Gutenberg module: https://cgit.drupalcode.org/gutenberg/tree/js/filters/media-upload.es6.js
@Qoraiche , @SofiaSousa , @vonloxx , Thanks a lot, guys! Will check the docs.
First of all, thank you for this great package! Originally in Gutenberg media library opens in a separate window. In Gutenberg-JS it opens a small popup with maximum of 10 images, with no pagination. From what I've found the original media library component is overrode here: https://github.com/front/gutenberg-js/blob/master/src/js/gutenberg-overrides/%40wordpress/edit-post/build-module/hooks/components/media-upload/index.js Am I correct? If yes - what is the purpose of overriding original component and is there a possibility to use the original one?