Closed asako08 closed 2 years ago
The plugin currently does not support this.
While investigating what it might take to support, I found an important notice in the blog post that announced the block editor support in widgets:
Don’t use
@wordpress/editor
Many legacy widgets call thewp.editor.initialize()
JavaScript function to instantiate a TinyMCE editor. If a plugin or block uses the@wordpress/editor
package and enqueueswp-editor
as a script dependency, this will re-define thewp.editor
global, often resulting in awp.editor.initialize is undefined
error.
This was the root cause of a previous bug that we resolved. The solution for now has been to only enable the Icon Chooser when it's either clearly a Gutenberg page, or clearly a Tiny MCE editor instance.
If there's some mixture on the same page, that's when this collision happens. And that warning in the feature announcement blog makes clear that we can expect such collisions to occur in the widget editor.
So we're stuck at this point: if we enable it in this context, it's going to end up breaking for someone--anyone who uses such legacy widgets.
I'm not yet sure how we're supposed to both:
@wordpress/editor
It may require finding (or creating) an example of such a legacy Widget that instantiates a TinyMCE editor in order to understand how it might work.
Unfortunately, I think the best that can be done for now is to type an [icon]
shortcode into those widget blocks without the help of the Icon Chooser.
Understand. Thank you very much. I'm selecting from Icon Chooser in a post and pasting it into a widget.
"Font Awesome Icon" is not displayed in the widget block editor. Is this a specification?
I hope it can be used in the widget block editor as well.