From 73e57cff445672b047b832534f2227e38876ad6e Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 16 May 2023 11:40:34 +1200 Subject: [PATCH] Add slug as classname to pattern block wrapper --- packages/block-library/src/pattern/edit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/pattern/edit.js b/packages/block-library/src/pattern/edit.js index c69ac359659cf..c22536a59eb03 100644 --- a/packages/block-library/src/pattern/edit.js +++ b/packages/block-library/src/pattern/edit.js @@ -65,7 +65,9 @@ const PatternEdit = ( { attributes, clientId } ) => { replaceBlocks, ] ); - const blockProps = useBlockProps(); + const blockProps = useBlockProps( { + className: slug?.replace( '/', '-' ), + } ); const innerBlocksProps = useInnerBlocksProps( blockProps, { templateLock: syncStatus === 'partial' ? 'contentOnly' : false,