-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
A page attributes panel slot now exists #61768
base: trunk
Are you sure you want to change the base?
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. |
"Phil's Fill" love it! 😆 |
Thanks for contributing, @philwp! Do you mind rebasing your branch on top of the latest trunk and resolving the merge conflict? |
Thanks for the work here. I think this raises the question about whether or not we want these panels to be extended like that or instead removed and replaced. Personally I lean towards "removed and replaced" instead because the extension point here is not clear. What happens if we redesign the panel, if we move it elsewhere... |
My question would be why not both? Allowing a user to remove the entire panel does make sense, but if a user wants to extend that panel, it would be better to allow them to just extend the existing panel. |
@philwp mostly because a slot is not a very good extensibility API in random components like that. It's like a placeholder for random things, if the design of said components changes or we decide to split it into multiple places/fields... it becomes kind of useless or breaks. In other words, I'm not sure a slot with small components like that is a good forward compatible API. It happened in the past already that we introduce slots in places like that and regret them. (PostExcerpt comes to mind) |
What?
Adding a Slot on the Page Attributes Panel
Why?
This resolves #31888 and allows plugin authors to extend that panel with additional information.
How?
Added a new Slot
PluginPageAttributesPanel
which adds a newpanelRow
below the panel items from core. This is essentially mimicking the behavior provided by thepage_attributes_misc_attributes
hook.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast