#60881 closed enhancement (fixed)
Introduce 'template_name' label to custom post types and custom taxonomies
Reported by: | aljullu | Owned by: | peterwilsoncc |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 6.1 |
Component: | Editor | Keywords: | has-patch commit gutenberg-merge dev-reviewed |
Focuses: | Cc: |
Description
Currently, there is no way to add user-friendly names to block templates generated automatically from custom post types and custom taxonomies.
This ticket is about introducing a new label: 'template_name', which could be used to label templates in the Site Editor instead of the currently used single_name
.
See https://github.com/WordPress/gutenberg/issues/60283 for more context.
Change History (17)
This ticket was mentioned in PR #6344 on WordPress/wordpress-develop by @aljullu.
5 months ago
#1
- Keywords has-patch added
@ntsekouras commented on PR #6344:
4 months ago
#2
Thanks for the PR! Can you create a trac ticket for this and link this PR?
3 months ago
#3
Can you create a trac ticket for this and link this PR?
Thanks for taking a look, @ntsekouras! The track ticket was already created: https://core.trac.wordpress.org/ticket/60881. It's linked from the PR description. :slightly_smiling_face:
3 months ago
#4
Thanks for the review, @audrasjb! I rebased this PR with the latest trunk
but I don't have permissions to merge. I also see some checks were cancelled or skipped, is that expected?
3 months ago
#6
Thanks again for the review, @peterwilsoncc, feedback should be addressed.
At the moment the archive is always shown as Archive: [CPT] but if WP is to allow for Single item: [CPT] to be customized it seems inconsistent not to allow the archive to be renamed too.
You mean adding a archive_template_name
label or something along these lines? AFAIK it hasn't been discussed, as I didn't think about this case. I'm happy to add it, but I would lean towards doing that in a separate PR to keep the scope of this one smaller, if that sounds good.
3 months ago
#7
Once again, thanks for the review, @peterwilsoncc! I don't have merge/commit access to the WordPress repo, so please let me know if there is anything else I can do from my end. :pray:
#8
@
3 months ago
@aljullu @ellatrix Will gutenberg#60367 be included in WordPress 6.6? If so, I'll add this to the milestone and commit it during the week.
#9
@
3 months ago
Will gutenberg#60367 be included in WordPress 6.6? If so, I'll add this to the milestone and commit it during the week.
I will let @ellatrix confirm, but AFAIK yes. gutenberg#60367 is included in Gutenberg 18.5, which will be included in WordPress 6.6.
#11
@
3 months ago
- Keywords commit added
- Milestone changed from Awaiting Review to 6.6
THe linked pull request has been approved and gutenberg#60367 will be in 6.6 so making this for commit and moving to the milestone.
#13
@
3 months ago
I have tested the Patch: PR-6344
I found:-
- Setting the template_name displays the string in the add new template screen. ✅ https://prnt.sc/B4slbn9qVW_1 https://prnt.sc/KH0p7q4NUHGm
- Setting labels without the template name displays the singular name ✅ https://prnt.sc/HyZBtizHYWVp https://prnt.sc/VEtgEDJ2_08t
- Setting neither $label nor $labels display the object slug to differentiate. ✅ https://prnt.sc/fy0tmRaR0FNP https://prnt.sc/dPR_Dfln9AZt
- Setting singular $label without $labels displays the $label in the default string. ✅ https://prnt.sc/Cd_7U7a6PcEH https://prnt.sc/KLbtRNfZYDD0
Looks good with the tests and changes. 👍
#14
@
3 months ago
- Owner set to peterwilsoncc
- Status changed from new to assigned
Hi there,
While 6.6 is officially closed for new enhancements, I believe we can make an exception for this one. Assigning the ticket to @peterwilsoncc who proposed to commit it.
This PR is a follow-up of https://github.com/WordPress/gutenberg/pull/60367 to:
template_name
label when registering post types and taxonomies.## Testing steps
{{{PHP
add_action( 'init', function () {
} );
}}}
template_name
to the post type and taxonomy:Trac ticket: https://core.trac.wordpress.org/ticket/60881