diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 0715b1e3547e2a..cb7baebf519b87 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -255,7 +255,7 @@ Hide and show additional content. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/details - **Category:** text - **Supports:** align (full, wide), anchor, color (background, gradients, link, text), interactivity (clientNavigation), layout (~~allowEditing~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** showContent, summary +- **Attributes:** allowedBlocks, showContent, summary ## Embed diff --git a/packages/block-library/src/details/block.json b/packages/block-library/src/details/block.json index 0cd0040cdde1b9..e28d94c03b9aa0 100644 --- a/packages/block-library/src/details/block.json +++ b/packages/block-library/src/details/block.json @@ -16,6 +16,9 @@ "type": "rich-text", "source": "rich-text", "selector": "summary" + }, + "allowedBlocks": { + "type": "array" } }, "supports": { diff --git a/packages/block-library/src/details/edit.js b/packages/block-library/src/details/edit.js index 9bebdee1a76706..9cf6a7a8456121 100644 --- a/packages/block-library/src/details/edit.js +++ b/packages/block-library/src/details/edit.js @@ -31,11 +31,12 @@ const TEMPLATE = [ ]; function DetailsEdit( { attributes, setAttributes, clientId } ) { - const { showContent, summary } = attributes; + const { showContent, summary, allowedBlocks } = attributes; const blockProps = useBlockProps(); const innerBlocksProps = useInnerBlocksProps( blockProps, { template: TEMPLATE, __experimentalCaptureToolbars: true, + allowedBlocks, } ); const dropdownMenuProps = useToolsPanelDropdownMenuProps();