-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PluginPostPublishPanel uses icon and inherits from registerPlugin #16383
PluginPostPublishPanel uses icon and inherits from registerPlugin #16383
Conversation
c1b0ae7
to
bea9ce1
Compare
…om registerPlugin
bea9ce1
to
e872a87
Compare
@mapk wondering if you can sign off on this PR as well? |
@ryanwelcher Can you guide me through some steps to test this? How do I get a custom panel to show in the post-publish slideout? |
@mapk it might be easiest to install this plugin I wrote for a talk I gave on SlotFill - https://github.com/ryanwelcher/the-gutenberg-slotfill-system. It demos all of the slots and if you have this branch active and built, you'll see the icons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Thanks for sorting it out 👍
I tested with:
( function() {
var el = wp.element.createElement;
var Fragment = wp.element.Fragment;
var __ = wp.i18n.__;
var registerPlugin = wp.plugins.registerPlugin;
var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
function PanelContent() {
return el(
'p',
{},
__( 'Here is the panel content!' )
);
}
function MyPublishPanelPlugin() {
return el(
Fragment,
{},
el(
PluginPrePublishPanel,
{
className: 'my-publish-panel-plugin__pre',
title: __( 'My pre publish panel' )
},
el(
PanelContent,
{}
)
),
el(
PluginPostPublishPanel,
{
className: 'my-publish-panel-plugin__post',
title: __( 'My post publish panel' )
},
el(
PanelContent,
{}
)
)
);
}
registerPlugin( 'my-publish-panel-plugin', {
icon: 'palmtree',
render: MyPublishPanelPlugin
} );
} )();
@mapk - I copied it over from the existing plugin which we use for e2e tests and can be activated in the plugins section for the default Gutenberg env:
However, I had to add the icon property. We might want to update the e2e test as well to have it covered.
Description
This PR updates the PluginPostPublishPanel SlotFill to accept an
icon
or inherit fromregisterPlugin()
Screenshots
Checklist: