-
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
Inspector: Display home / posts page badge #62071
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: +181 B (+0.01%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
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.
Seems okay, would appreciate a code check before you land.
> | ||
{ title ? decodeEntities( title ) : __( 'No Title' ) } | ||
{ isFrontPage && ( | ||
<span className="editor-post-card-panel__title-badge"> |
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.
Is this badge something that can become a generic UI components to move to the components package? We're using it in multiple places now.
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.
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.
Yes please #61106
} ), | ||
isSync: _isSync, | ||
isFrontPage: siteSettings?.page_on_front === _id, | ||
isPostsPage: siteSettings?.page_for_posts === _id, |
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.
In other places the "id" here was typecast into an integer to work. I don't know whether it's needed here. cc @ntsekouras
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.
There was definitely an issue with some endpoint or selector in the past that would return a string
id, but couldn't pinpoint it now.. By debugging and looking at the code, at least in these checks, both values are numbers. So it's safe to leave as is.
Co-authored-by: jameskoster <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: jameskoster <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: ntsekouras <[email protected]>
What?
Display a badge in the Inspector when editing the front page or the posts page.
Why?
In data views this badge appears next to the title to help you identify these pages. However there's nothing in the Editor to communicate this detail.
Testing Instructions
As a follow-up it might be nice to update the icon too, but as that will involve touching the command palette/document title I'd prefer to explore it separately.