-
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
Update 'Add template' screen to prefer template_name label instead of singular_name #60367
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: +103 B (+0.01%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
48f049c
to
71d5748
Compare
71d5748
to
79aedb2
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.
This LGTM, thanks! I tested various combinations with template_name, name, singular_name
and omitting labels to use defaults without noticing anything not expected. Code looks good too, great work!
Flaky tests detected in 79aedb2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9220371508
|
… singular_name (WordPress#60367) Co-authored-by: Aljullu <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: mcsf <[email protected]>
… singular_name (WordPress#60367) Co-authored-by: Aljullu <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: mcsf <[email protected]>
Fixes #60283.
Related PR on WordPress: WordPress/wordpress-develop#6344.
What?
This PR makes it so the Add template screen displays the
template_name
label for CPT and custom taxonomy templates, instead of relying onsingular_name
.Why?
This way, we allow plugins to add user-friendly names to templates related to their CPT/custom taxonomies.
How?
This PR makes it so
template_name
takes priority oversingular_name
when possible. It also accounts for the cases of:template_name
being missing, in which case we fall back tosingular_name
, as it used to work.template_name
being duplicate, in which case the CPT/custom taxonomy slug is displayed.Testing Instructions
template_name
to the post type and taxonomy: