Description
Splitting this out from #68688
PluginPrePublishPanel adds a panel to the pre-publish sidebar. It can be used 'standalone', for example directly in the editor somewhere, or in a registered plugin.
It is part of the editor package so that to my understanding using it 'standalone' directly in the editor is allowed.
When used 'standalone' and no icon prop is passed, it doesn't render an icon.
Instead, when used in a registered plugin, it either shows the passed icon or the fallback plugin icon that comes from usePluginContext. This is intentional to make it 'inherit' the icon a plugin may use in its registerPlugin() call. This way, the panel will use the same icon that it is shown in the 'pinned' plugin icon in the editor top bar.
Plugins can pass a different icon for the sidebar panel. However, the cannot unset the icon shown in the sidebar panel. It will fallback to the generic 'plugin' icon.
There may be cases where a plugin may want to show an icon for the 'pinned' button in the top bar but may not want to show an icon in the sidebar panel. It seems to me the current implementation assumes there should always be an icon, which isn't necessarily what plugins want.
There are workarounds e.g. passing an empty fragment icon={ <></> } but that's not great. I'd tend to think there should be a way for plugins to unset the icon of the sidebar panel.
It is worth nothing that the editor itself resigters some plugins e.g.
Step-by-step reproduction instructions
Register a simple plugin for hte pre-publish panel somewhere in the code e.g.
import { registerPlugin } from '@wordpress/plugins';
import { PluginPrePublishPanel } from '@wordpress/editor';
registerPlugin( 'my-test-plugin-panel', {
render() {
return (
<PluginPrePublishPanel
className="my-plugin-pre-publish-panel"
title="My plugin panel title"
initialOpen
>
My plugin panel content
</PluginPrePublishPanel>
);
},
} );
- Edit a post and click Publish to make the pre-publish sidebar appear.
- Observe the panel added by your plugin shows a default icon. Screenshot:

Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
Splitting this out from #68688
PluginPrePublishPanel adds a panel to the pre-publish sidebar. It can be used 'standalone', for example directly in the editor somewhere, or in a registered plugin.
It is part of the
editorpackage so that to my understanding using it 'standalone' directly in the editor is allowed.When used 'standalone' and no
iconprop is passed, it doesn't render an icon.Instead, when used in a registered plugin, it either shows the passed icon or the fallback plugin icon that comes from
usePluginContext. This is intentional to make it 'inherit' the icon a plugin may use in itsregisterPlugin()call. This way, the panel will use the same icon that it is shown in the 'pinned' plugin icon in the editor top bar.Plugins can pass a different icon for the sidebar panel. However, the cannot unset the icon shown in the sidebar panel. It will fallback to the generic 'plugin' icon.
There may be cases where a plugin may want to show an icon for the 'pinned' button in the top bar but may not want to show an icon in the sidebar panel. It seems to me the current implementation assumes there should always be an icon, which isn't necessarily what plugins want.
There are workarounds e.g. passing an empty fragment
icon={ <></> }but that's not great. I'd tend to think there should be a way for plugins to unset the icon of the sidebar panel.It is worth nothing that the editor itself resigters some plugins e.g.
Step-by-step reproduction instructions
Register a simple plugin for hte pre-publish panel somewhere in the code e.g.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.