Post Editor: use the post type singular_name as the root Block Breadcrumb label#32609
Merged
ntsekouras merged 5 commits intoWordPress:trunkfrom Jun 11, 2021
Conversation
3 tasks
kevin940726
approved these changes
Jun 11, 2021
packages/edit-post/src/components/sidebar/settings-header/index.js
Outdated
Show resolved
Hide resolved
ntsekouras
reviewed
Jun 11, 2021
ntsekouras
reviewed
Jun 11, 2021
Contributor
ntsekouras
left a comment
There was a problem hiding this comment.
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
Member
Author
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
ntsekouras
approved these changes
Jun 11, 2021
Contributor
ntsekouras
left a comment
There was a problem hiding this comment.
Looks good! Let's 🚢 and iterate on template title.
Logic could probably be like in the TemplateTitle component.
Member
Author
Thank you for the thorough review and for the tip about TemplateTitle 🙇 !! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsfiles for terms that need renaming or removal).