gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Use lowercase capitalization on Featured Image "Link to..." control

Open richtabor opened this issue 2 years ago • 6 comments

The post type value should be lowercased, like "Link to page".

CleanShot 2023-10-04 at 14 16 09

richtabor avatar Oct 04 '23 18:10 richtabor

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?

properlypurple avatar Oct 09 '23 02:10 properlypurple

It shouldn't be programmatically lowercased for sure.

richtabor avatar Oct 09 '23 14:10 richtabor

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?

colinduwe avatar Dec 07 '23 00:12 colinduwe

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!

benoitchantre avatar Jun 05 '25 09:06 benoitchantre

Related PR : https://github.com/WordPress/wordpress-develop/pull/8910

benoitchantre avatar Jun 05 '25 09:06 benoitchantre

@richtabor What do you think about adding a new post type label as mentioned above?

johnbillion avatar Jun 05 '25 12:06 johnbillion

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:

Image

This format is commonly used:

https://github.com/search?q=repo%3AWordPress%2Fgutenberg+%22%3A+%25s%27+%29%22+path%3A*.js&type=code

t-hamano avatar Jul 21 '25 04:07 t-hamano

Hi, I would like to work on this issue.

Alkasingh09 avatar Jul 23 '25 20:07 Alkasingh09

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.

johnbillion avatar Jul 23 '25 21:07 johnbillion

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.

t-hamano avatar Jul 24 '25 07:07 t-hamano

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.

Image

t-hamano avatar Jul 26 '25 06:07 t-hamano

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.

t-hamano avatar Jul 26 '25 08:07 t-hamano

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?

rajanarahul93 avatar Sep 27 '25 04:09 rajanarahul93

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?

t-hamano avatar Sep 27 '25 06:09 t-hamano