diff --git a/packages/block-library/src/social-links/block.json b/packages/block-library/src/social-links/block.json index b174a1e86dd3d2..3d35f11f23c13a 100644 --- a/packages/block-library/src/social-links/block.json +++ b/packages/block-library/src/social-links/block.json @@ -3,6 +3,10 @@ "name": "core/social-links", "category": "widgets", "attributes": { + "allowedBlocks": { + "type": "array", + "default": [ "core/social-link" ] + }, "iconColor": { "type": "string" }, diff --git a/packages/block-library/src/social-links/edit.js b/packages/block-library/src/social-links/edit.js index 44abbf168c701f..4585ad110955d8 100644 --- a/packages/block-library/src/social-links/edit.js +++ b/packages/block-library/src/social-links/edit.js @@ -31,8 +31,6 @@ import { import { __ } from '@wordpress/i18n'; import { check } from '@wordpress/icons'; -const ALLOWED_BLOCKS = [ 'core/social-link' ]; - const sizeOptions = [ { name: __( 'Small' ), value: 'has-small-icon-size' }, { name: __( 'Normal' ), value: 'has-normal-icon-size' }, @@ -51,6 +49,7 @@ export function SocialLinksEdit( props ) { } = props; const { + allowedBlocks, iconBackgroundColorValue, iconColorValue, itemsJustification, @@ -93,7 +92,7 @@ export function SocialLinksEdit( props ) { const blockProps = useBlockProps( { className } ); const innerBlocksProps = useInnerBlocksProps( blockProps, { - allowedBlocks: ALLOWED_BLOCKS, + allowedBlocks, orientation: 'horizontal', placeholder: SocialPlaceholder, templateLock: false,