-
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
DataViews: Fix text in action for setting site home page #67787
Conversation
|
||
const modalText = sprintf( | ||
// translators: %1$s: title of the page to be set as the homepage, %2$s: homepage replacement warning message. | ||
__( 'Set "%1$s" as the site homepage? %2$s' ), | ||
pageTitle, | ||
modalWarning | ||
); | ||
).trim(); |
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.
This prevents a space from being left at the end of the modalText
variable if modalWarning
is an empty string.
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: +33 B (0%) Total Size: 1.83 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.
Thanks @t-hamano!
This fixes an issue I was seeing in #65426 that I was struggling to replicate consistently.
In my testing this works as advertised 👍
- Homepage: empty / Posts page: empty ✅
- Homepage: The page is set / Posts page: empty ✅
- Homepage: empty / Posts page: The page is set ✅
- Homepage: The page is set / Posts page: The page is set ✅
@mikachan Thanks for the review! |
Related to #65426
What?
Fixes odd text that appears when setting the home page via the DataViews in the following settings:
When only the "Posts page" is set, it shows that it will replace the homepage even though no homepage has been set yet. Additionally, the page title is empty:
Testing Instructions
Screenshots or screencast
The correct text should now be displayed in all scenarios.
Homepage: empty / Posts page: empty
Homepage: The page is set / Posts page: empty
Homepage: empty / Posts page: The page is set
Homepage: The page is set / Posts page: The page is set