-
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
Add PluginDocumentSettingPanel in template inspector controls #60961
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Should we add PluginDocumentSettingPanel
to TemplatePanel
with this change?
I actually didn't want to approve yet, we should first add the alternative to |
You're right! I added it. |
I think even in the post editor we need to relax a check to render |
Size Change: +126 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
I did that and also moved some panels to a lower level since we have checks for them. |
<PostExcerptPanel /> | ||
<PostDiscussionPanel /> | ||
<PageAttributesPanel /> | ||
<PatternOverridesPanel /> |
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.
Do you think that all of these components being rendered for templates is fine? It probably is just want to confirm that it doesn't result in different UIs than trunk :)
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.
They were still rendered here: https://github.com/WordPress/gutenberg/pull/60961/files#diff-6139877d7164dad773ae6521334135a37eb7e0bb351ade4c4f2169aa69da6e34L137 in site editor, so it should be the same in post editor, since they have checks whether to render or not.
The alternative would be to separate them in site editor too(the above linked code) and just remove them from there and keep them in PagePanels.
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.
Additionally the revisions panel was rendered in site editor and now it does in post editor too.
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.
Definitely worth unifying like you did.
This is looking good. I'm guessing this is also a new API for the post editor :) (templates panels were only extensible in the site editor), so it's an enhancement. @Mamaduka any thoughts about this PR? |
) } | ||
{ ! isEditingTemplate && <PostStatus /> } | ||
<PluginDocumentSettingPanel.Slot /> | ||
<PostLastRevisionPanel /> |
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.
Unlike other post-type properties, the wp_template
supports revisions, and unlike the trunk, this might result in revision panel rendering for templates.
I think @ntsekouras answered my questions here -#60961 (comment).
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.
The changes look good. The Panel
components now rely on post-type support checks instead of hardcoding a post-type slug condition.
Side note: We might want to introduce a status
("Summary) flag in the post-type support settings.
What?
This PR moves some panels around in order to be rendered for both posts and templates. That was already the case for most panels in site editor. The main addition is that
PluginDocumentSettingPanel
is also rendered for templates too, so extenders can use this slot in this case.Additionally in this PR, but with the unification effort it has been suggested that we could use
PluginDocumentSettingPanel
instead.Technically we cannot use internally
PluginDocumentSettingPanel
slot, because it checks if the panel is opened, which is false by default and that results in not showing the contents. The other difference is that this slot didn't render the PanelBody whereas PluginDocumentSettingPanel does. So we soft deprecates the PluginTemplateSettingPanel.Testing Instructions
PluginDocumentSettingPanel should also work for templates