Use lowercase capitalization on Featured Image "Link to..." control
The post type value should be lowercased, like "Link to page".
It looks an opposite of this was reported in #49587 and it was fixed in https://github.com/WordPress/gutenberg/pull/49591
@richtabor Is there any new discussion/decision on how this should be?
It shouldn't be programmatically lowercased for sure.
The control's label is using the post type's singular_name label which is typically capitalized (see here)
Since the direction in https://github.com/WordPress/gutenberg/issues/49587 and from @richtabor is not to programmatically lowercase it, is this at a dead end? Or is there a lowercase singular label that I'm forgetting about?
Per discussion with @johnbillion during the Contributor Day, the best solution would be to add a new label for post types, then use it if available. That would allow better translations in some languages.
Core ticket: https://core.trac.wordpress.org/ticket/63534
Thank you John!
Related PR : https://github.com/WordPress/wordpress-develop/pull/8910
@richtabor What do you think about adding a new post type label as mentioned above?
Adding a new label field to the post type just for this control seems like overkill.
I'd like to suggest using the Link to: {PostTypeLabel} format instead:
This format is commonly used:
https://github.com/search?q=repo%3AWordPress%2Fgutenberg+%22%3A+%25s%27+%29%22+path%3A*.js&type=code
Hi, I would like to work on this issue.
I disagree that adding a new post type label is overkill, their purpose is to allow post types to provide accurate labels that read clearly and can be well translated. Link to: Post doesn't make much sense.
The Link to {postType} text currently only exists in two places, the Post Featured Image block and the Post Date block, so I just wanted to consider a different approach before adding new labels just for these.
However, there are no strong opinions, so if enough people prefer adding new labels, I'll obey that approach.
Another idea: change the label to Make image a link. The Title block has a setting called Make title a link to link the post.
Again, please note that the approach of programmatically lowercasing the post type label is not recommended - while this approach may work for English, it may not work for other locales.
I have a patch ready that changes the toggle label to “Make image a link,” following the suggestion from @t-hamano
Could a maintainer confirm that this is the preferred text before I open a PR?
I have a patch ready that changes the toggle label to “Make image a link,” following the suggestion from @t-hamano
I prefer this approach.
- It's unaffected by post types.
- It's localization-friendly.
- It doesn't require defining new post type labels.
What do others think?