Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ToggleControl,
TextControl,
__experimentalVStack as VStack,
ExternalLink,
} from '@wordpress/components';
import {
Icon,
Expand Down Expand Up @@ -230,9 +231,19 @@ const ImageURLInputUI = ( {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label={ __( 'Link Relation' ) }
label={ __( 'Link relation' ) }

I think similar labels use sentence case. See: https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/documentation/copy-guide.md#five-pay-attention-to-capitalization

value={ rel ?? '' }
onChange={ onSetLinkRel }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'The Link Relation attribute defines the relationship between a linked resource and the current document.'
'The link relation attribute defines the relationship between a linked resource and the current document.'

I think we should use standard casing here. This matches casing in the MDN article.

Note: Label and text changes should be the same everywhere.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
/>
<TextControl
__next40pxDefaultSize
Expand Down
13 changes: 12 additions & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
TextControl,
ToolbarButton,
Popover,
ExternalLink,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
__experimentalToggleGroupControl as ToggleGroupControl,
Expand Down Expand Up @@ -474,7 +475,17 @@ function ButtonEdit( props ) {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid using meaningless link text like "Learn more". Can we instead place the link on the word "link relation attribute"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joedolson. I'd incorporate those changes. Btw, what do you think about the sentence case thing suggested by @Mamaduka earlier?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-09-10 at 7 59 36 PM

@Mamaduka @joedolson I have got the link inline with element interpolation. From what I think, now it makes sense to keep the casings as it is since now "Link Relation" is a term that we refer externally directly by clicking on it. I am not sure though and not aware if any guidelines are there for such a case. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have a strong opinion here; I usually follow the text copy guidelines. We could keep casing in the help text, but let's fix it for the label.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the label above the input box? That is capitalized automatically. All labels are like that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! Done.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
value={ rel || '' }
onChange={ ( newRel ) =>
setAttributes( { rel: newRel } )
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/button/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function ButtonEdit( props ) {
label: __( 'Open in new tab' ),
},
linkRel: {
label: __( 'Link Rel' ),
label: __( 'Link Relation' ),
placeholder: _x( 'None', 'Link rel attribute value placeholder' ),
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function LinkSettings( {
label: __( 'Open in new tab' ),
},
linkRel: {
label: __( 'Link Rel' ),
label: __( 'Link Relation' ),
placeholder: _x( 'None', 'Link rel attribute value placeholder' ),
},
};
Expand Down
15 changes: 13 additions & 2 deletions packages/block-library/src/post-featured-image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Button,
Spinner,
TextControl,
ExternalLink,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
Expand Down Expand Up @@ -316,7 +317,7 @@ export default function PostFeaturedImageEdit( {
) }
{ isLink && (
<ToolsPanelItem
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
isShownByDefault
hasValue={ () => !! rel }
onDeselect={ () =>
Expand All @@ -328,7 +329,17 @@ export default function PostFeaturedImageEdit( {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous request.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
value={ rel }
onChange={ ( newRel ) =>
setAttributes( { rel: newRel } )
Expand Down
15 changes: 13 additions & 2 deletions packages/block-library/src/post-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import {
ToggleControl,
TextControl,
ExternalLink,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
Expand Down Expand Up @@ -205,7 +206,7 @@ export default function PostTitleEdit( {
/>
</ToolsPanelItem>
<ToolsPanelItem
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
isShownByDefault
hasValue={ () => !! rel }
onDeselect={ () =>
Expand All @@ -215,7 +216,17 @@ export default function PostTitleEdit( {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous request.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
value={ rel }
onChange={ ( newRel ) =>
setAttributes( { rel: newRel } )
Expand Down
13 changes: 12 additions & 1 deletion packages/block-library/src/rss/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ToggleControl,
ToolbarGroup,
TextControl,
ExternalLink,
__experimentalInputControl as InputControl,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
Expand Down Expand Up @@ -301,7 +302,17 @@ export default function RSSEdit( { attributes, setAttributes } ) {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous request.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
value={ rel || '' }
onChange={ ( value ) => setAttributes( { rel: value } ) }
/>
Expand Down
13 changes: 12 additions & 1 deletion packages/block-library/src/social-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
Dropdown,
TextControl,
ToolbarButton,
ExternalLink,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,
Expand Down Expand Up @@ -243,7 +244,17 @@ const SocialLinkEdit = ( {
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Link rel' ) }
label={ __( 'Link Relation' ) }
help={
<>
{ __(
'The Link Relation attribute defines the relationship between a linked resource and the current document.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous request.

) }{ ' ' }
<ExternalLink href="https://developer.mozilla.org/docs/Web/HTML/Attributes/rel">
{ __( 'Learn more.' ) }
</ExternalLink>
</>
}
value={ rel || '' }
onChange={ ( value ) => setAttributes( { rel: value } ) }
/>
Expand Down