-
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
Fix layout for non viewable post types #58962
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. |
Size Change: +46 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Mmm, so it turns out that testing viewable is not strictly equivalent to what we want (e2e failure), we want to be able to fill the "title" for some non public post types as well excluding (wp_block, wp_navigation, wp_template_part and wp_template). So I'm going to use a fix list for these. |
/** | ||
* These post types have a special editor where they don't allow you to fill the title | ||
* and they don't apply the layout styles. | ||
*/ | ||
const DESIGN_POST_TYPES = [ | ||
'wp_block', | ||
'wp_template', | ||
'wp_navigation', | ||
'wp_template_part', | ||
]; |
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.
I'm fine with this fix, but of course I wonder if there's a systematic way to do it instead of using constants.
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.
I think there are multiple things at play here and we need a way for post styles to say:
- I'm rendered within a template (isViewable), so this should probably control the layout
- Users can edit the title in the canvas: We don't have anything for that, thus the need for this custom array for now.
I'm not sure what the right fix would be for the last part yet, so I kept it like 6.4 for now but indeed, it seems there's some rule missing/flag/support missing here.
Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: glendaviesnz <glendaviesnz@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Backported |
Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: glendaviesnz <glendaviesnz@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: glendaviesnz <glendaviesnz@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Note that as part of curating the Gutenberg 17.8 changelog, I added the label [Package] Editor to this PR to better categorize it. Please let me know if there is a different label that would be a better fit. |
closes #58956
What?
Post Types that are not "viewable", which basically means post types that don't get rendered within a template in the frontend shouldn't get the post content or global layout applied when rendered in the editor. This fixes a regression introduced in #58935 where this was taking into consideration by using the "all" rendering mode.
Testing Instructions
1- Open the site editor
2- Ensure that the layout is correct (no extra title is added and the content is not narrow)