-
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
Post Editor: use the post type singular_name as the root Block Breadcrumb label #32609
Post Editor: use the post type singular_name as the root Block Breadcrumb label #32609
Conversation
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.
Code LGTM! Thank you! ❤️
packages/edit-post/src/components/sidebar/settings-header/index.js
Outdated
Show resolved
Hide resolved
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 also update the root when editing a template? I guess it's okay for a follow up though.
…crumb root label.
Removing unnecessary comment in the selector.
8f18899
to
0966dd2
Compare
Definitely! I did want to add it to this PR however templates/template parts don't return a |
…ly returning null in the `getPostTypeLabel` selector. Using `_x` so we can add context for the word Document, so we can differentiate between noun/verb. Updated tests
0966dd2
to
46a21b8
Compare
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.
Looks good! Let's 🚢 and iterate on template title.
Logic could probably be like in the TemplateTitle
component.
Thank you for the thorough review and for the tip about TemplateTitle 🙇 !! |
Description
#17311 introduced post type labels as the document label in the sidebar.
This PR does the same trick, but for the Block Breadcrumb.
Context: #32528 (comment)
This PR only affects the post editor. If a post type is unknown or cannot be found, we default back to
__( 'Document' )
.How has this been tested?
Unit test for the selector:
Screenshots
Types of changes
Adds the post type label to the Block Breadcrumb root label.
Checklist:
*.native.js
files for terms that need renaming or removal).