PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.8.0
GenerateBlocks v1.8.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / utils / get-editor-blocks.js
generateblocks / src / utils Last commit date
add-to-css 3 years ago build-css 6 years ago check-block-version 4 years ago compatible-render 2 years ago filter-attributes 2 years ago flexbox-alignment 6 years ago get-attribute 4 years ago get-background-image 4 years ago get-background-image-url 4 years ago get-device-type 3 years ago get-dynamic-image 4 years ago get-icon 2 years ago get-image-sizes 4 years ago get-media-url 4 years ago get-responsive-placeholder 2 years ago get-unique-block-names 2 years ago has-numeric-value 4 years ago hex-to-rgba 2 years ago is-flex-item 3 years ago is-numeric 2 years ago sanitize-svg 5 years ago shorthand-css 2 years ago should-rebuild-css 4 years ago sizingValue 3 years ago value-with-unit 2 years ago was-block-just-inserted 4 years ago get-editor-blocks.js 2 years ago object-is-empty.js 4 years ago
get-editor-blocks.js
23 lines
1 /**
2 * Return the blocks with its inner blocks.
3 *
4 * @return {Array} The blocks array.
5 */
6 export default () => {
7 const blocks = wp.data.select( 'core/block-editor' ).getBlocks();
8
9 return blocks.map( ( block ) => {
10 if ( 'core/widget-area' !== block.name ) {
11 return block;
12 }
13
14 // For the widget editor we need to manually get the inner blocks.
15 const innerBlocks = wp.data.select( 'core/block-editor' ).getBlocks( block.clientId );
16
17 return {
18 ...block,
19 innerBlocks,
20 };
21 } );
22 };
23