-
Notifications
You must be signed in to change notification settings - Fork 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
FSE: Hide the UI for the post content slot in the editor #35081
Conversation
…heet to the post content slot block stylesheet.
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
}; | ||
}, 'addContentSlotClassname' ); | ||
|
||
wp.hooks.addFilter( |
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.
For code consistency let's update this to
import { addFilter } from '@wordpress/hooks';
//...
addFilter(
|
||
return <BlockListBlock { ...props } className={ 'post-content__block' } />; | ||
}; | ||
}, 'addContentSlotClassname' ); |
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 TIL, I didn't know about this one!
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.
Nor did I! I found it by just scanning through all the available filters. I think this will come in handy for a couple of other issues. 👍
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.
Thanks @apeatling this is good to 🚢 after the hooks syntax is updated 👍
Noting that it's still possible to see content slot block options (clicking next to page title), but we can fix that on a follow up.
Added #35094 for follow up |
* Hide the UI for the post content slot in the editor. * Move the post content slot block UI CSS from the global editor stylesheet to the post content slot block stylesheet. * Update to support external WordPress hooks dependency, props @gwwar
Changes proposed in this Pull Request
The UI for the post content slot is not needed and distracts from editing the post content blocks themselves. This could change in the future if we add settings, but it is not true right now.
This PR adds a top level classname to the post content slot block, and uses that classname to hide the editor UI using CSS. It's a bit of a hack, although I'm not sure there is any other way of hiding block UI at this point (happy to be pointed to something).
Before:
After:
Testing instructions
Fixes #34889