diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index b2f3b712d25c51..dd9fdbdc0566b0 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -753,7 +753,7 @@ Display an icon linking to a social media profile or site. ([Source](https://git - **Name:** core/social-link - **Category:** widgets - **Supports:** ~~html~~, ~~reusable~~ -- **Attributes:** label, service, url +- **Attributes:** label, rel, service, url ## Social Icons diff --git a/packages/block-library/src/social-link/block.json b/packages/block-library/src/social-link/block.json index 90a3f270d738d7..5f64b7dcf777c5 100644 --- a/packages/block-library/src/social-link/block.json +++ b/packages/block-library/src/social-link/block.json @@ -16,6 +16,9 @@ }, "label": { "type": "string" + }, + "rel": { + "type": "string" } }, "usesContext": [ diff --git a/packages/block-library/src/social-link/edit.js b/packages/block-library/src/social-link/edit.js index 7e6a51618a8972..fab49838afa2e4 100644 --- a/packages/block-library/src/social-link/edit.js +++ b/packages/block-library/src/social-link/edit.js @@ -66,7 +66,7 @@ const SocialLinkEdit = ( { isSelected, setAttributes, } ) => { - const { url, service, label } = attributes; + const { url, service, label, rel } = attributes; const { showLabels, iconColorValue, iconBackgroundColorValue } = context; const [ showURLPopover, setPopover ] = useState( false ); const classes = classNames( 'wp-social-link', 'wp-social-link-' + service, { @@ -113,6 +113,13 @@ const SocialLinkEdit = ( { + + setAttributes( { rel: value } ) } + /> +