PluginProbe
Scrollsequence – Cinematic Scroll Image Animation Plugin / 1.5.5
Scrollsequence – Cinematic Scroll Image Animation Plugin v1.5.5
1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 trunk 0.9.92 0.9.93 0.9.94 0.9.96 1.0.072 1.0.073 All 61 releases
scrollsequence / includes / carbonfields / htmlburger / carbon-fields / packages / blocks / components / block-save / index.js

index.js in Scrollsequence – Cinematic Scroll Image Animation Plugin 1.5.5, at includes/carbonfields/htmlburger/carbon-fields/packages/blocks/components/block-save/index.js

42 lines 769 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * External dependencies.
3 */
4 import { Component } from '@wordpress/element';
5 import { InnerBlocks } from '@wordpress/editor';
6
7 class BlockSave extends Component {
8 /**
9 * Render the component.
10 *
11 * @return {null}
12 */
13 render() {
14 return null;
15 }
16 }
17
18 /**
19 * Adds the content of inner blocks to the saved content.
20 *
21 * @param {mixed} element
22 * @param {Object} blockType
23 * @return {mixed}
24 */
25 function addInnerBlocksContent( element, blockType ) {
26 if ( ! /^carbon\-fields\/.+$/.test( blockType.name ) ) {
27 return element;
28 }
29
30 if ( ! blockType.supports.innerBlocks ) {
31 return element;
32 }
33
34 return (
35 <InnerBlocks.Content />
36 );
37 }
38
39 wp.hooks.addFilter( 'blocks.getSaveElement', 'carbon-fields/blocks', addInnerBlocksContent );
40
41 export default BlockSave;
42