You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, this plugin currently does not support it because that particular editing interface involves the possibility of legacy widgets that may rely on the ability to instantiate the classic Tiny MCE editor. This is specifically called out in that feature announcement:
Don’t use @wordpress/editor
Many legacy widgets call the wp.editor.initialize() JavaScript function to instantiate a TinyMCE editor. If a plugin or block uses the @wordpress/editor package and enqueues wp-editor as a script dependency, this will re-define the wp.editor global, often resulting in a wp.editor.initialize is undefined error.
But this was the same root cause of a problem we previously had with this plugin, when depending on wp-editor for block editor integration, and being loaded in a context where another plugin relies on the availability of that wp.editor.initialize global for instantiating TinyMCE. The RankMath plugin was the initial reported case in the support forum.
To make this feature work would require some further investigation as to whether it is even possible for us to add the Icon Chooser to that block editor's format bar within the widget editor without depending on @wordpress/editor.
How is anyone else accomplishing this?
Even if we find a solution, it seems likely that some other component will make this mistake. Seems like a foot gun that will be claiming a lot of toes.
Heads Up: Two Paths with Different Properties
As the feature announcement indicates, there are two different ways that this feature is encountered:
Appearance → Widgets
In initial exploration, this can be enabled by simply adding widgets.php to the list of screens for which the icon chooser should be enabled.
This is because (if I recall, correctly), our is_gutenberg_page() returns true in this scenario. Thus it satisfies the constraint we put in previously: only enable the Icon Chooser with block editor integration when it's clearly a Gutenberg page.
But this doesn't rule out the possibility of the error condition called about above. It will end up assigning to the wp.editor global, and thus possibly creating a problem for any legacy widgets that try to invoke the global wp.editor.initialize().
Appearance → Customize → Widgets
In initial exploration, even though the address bar looks like customize.php, there's also an iframe involved. So the current screen that is active when our code runs still ends up being widgets.php. However, is_gutenberg_page() is false in this context.
So making this work will require not just turning it on (because that's not too difficult), but finding a way to turn it on that doesn't break others.
WordPress 5.8 introduced block editing to the widget editing interfaces.
Unfortunately, this plugin currently does not support it because that particular editing interface involves the possibility of legacy widgets that may rely on the ability to instantiate the classic Tiny MCE editor. This is specifically called out in that feature announcement:
But this was the same root cause of a problem we previously had with this plugin, when depending on
wp-editor
for block editor integration, and being loaded in a context where another plugin relies on the availability of thatwp.editor.initialize
global for instantiating TinyMCE. The RankMath plugin was the initial reported case in the support forum.To make this feature work would require some further investigation as to whether it is even possible for us to add the Icon Chooser to that block editor's format bar within the widget editor without depending on
@wordpress/editor
.How is anyone else accomplishing this?
Even if we find a solution, it seems likely that some other component will make this mistake. Seems like a foot gun that will be claiming a lot of toes.
Heads Up: Two Paths with Different Properties
As the feature announcement indicates, there are two different ways that this feature is encountered:
Appearance → Widgets
In initial exploration, this can be enabled by simply adding
widgets.php
to the list of screens for which the icon chooser should be enabled.wordpress-fontawesome/includes/class-fontawesome.php
Line 280 in 7cfd95c
This is because (if I recall, correctly), our
is_gutenberg_page()
returnstrue
in this scenario. Thus it satisfies the constraint we put in previously: only enable the Icon Chooser with block editor integration when it's clearly a Gutenberg page.But this doesn't rule out the possibility of the error condition called about above. It will end up assigning to the
wp.editor
global, and thus possibly creating a problem for any legacy widgets that try to invoke the globalwp.editor.initialize()
.Appearance → Customize → Widgets
In initial exploration, even though the address bar looks like
customize.php
, there's also aniframe
involved. So the current screen that is active when our code runs still ends up beingwidgets.php
. However,is_gutenberg_page()
isfalse
in this context.So making this work will require not just turning it on (because that's not too difficult), but finding a way to turn it on that doesn't break others.
See also:
The text was updated successfully, but these errors were encountered: