PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.0.0
GenerateBlocks v2.0.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 / blocks / shape / save.js
generateblocks / src / blocks / shape Last commit date
components 1 year ago block.json 1 year ago edit.js 1 year ago index.js 1 year ago save.js 1 year ago
save.js
36 lines
1 /**
2 * WordPress dependencies
3 */
4 import { useBlockProps } from '@wordpress/block-editor';
5 import sanitizeSVG from '../../utils/sanitize-svg';
6 import { getBlockClasses } from '@utils/getBlockClasses';
7
8 export function Save( { attributes } ) {
9 const {
10 html,
11 htmlAttributes = {},
12 } = attributes;
13
14 const classNames = getBlockClasses(
15 'gb-shape',
16 attributes,
17 true
18 );
19
20 const blockProps = useBlockProps.save(
21 {
22 className: classNames.join( ' ' ).trim(),
23 ...htmlAttributes,
24 }
25 );
26
27 return (
28 <span
29 { ...blockProps }
30 dangerouslySetInnerHTML={
31 { __html: sanitizeSVG( html ) }
32 }
33 />
34 );
35 }
36