From 07c948dfa56f51923c668c430b3bdff9d14e6a1b Mon Sep 17 00:00:00 2001 From: Dean Sas Date: Wed, 9 Nov 2022 23:25:31 +0000 Subject: [PATCH] Columns: Add transform to unwrap the contents (#45666) Add a transform to move the column contents out into standalone blocks. --- packages/block-library/src/columns/transforms.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/block-library/src/columns/transforms.js b/packages/block-library/src/columns/transforms.js index 9fb80e49e4295c..04fc932f529643 100644 --- a/packages/block-library/src/columns/transforms.js +++ b/packages/block-library/src/columns/transforms.js @@ -105,6 +105,16 @@ const transforms = { }, }, ], + to: [ + { + type: 'block', + blocks: [ '*' ], + transform: ( attributes, innerBlocks ) => + innerBlocks + .map( ( innerBlock ) => innerBlock.innerBlocks ) + .flat(), + }, + ], }; export default transforms;