Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
generateblocks
/
src
/
utils
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * Return the blocks with its inner blocks. * * @return {Array} The blocks array. */ export default () => { const blocks = wp.data.select( 'core/block-editor' ).getBlocks(); return blocks.map( ( block ) => { if ( 'core/widget-area' !== block.name ) { return block; } // For the widget editor we need to manually get the inner blocks. const innerBlocks = wp.data.select( 'core/block-editor' ).getBlocks( block.clientId ); return { ...block, innerBlocks, }; } ); };