components
1 year ago
block.json
1 year ago
edit.js
1 year ago
index.js
1 year ago
looper.js
1 year ago
query-parameters.js
1 year ago
save.js
1 year ago
templates.js
1 year ago
toolbar-appenders.js
1 year ago
save.js
29 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | import { getBlockClasses } from '@utils/getBlockClasses'; |
| 5 | import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor'; |
| 6 | |
| 7 | export function Save( { attributes } ) { |
| 8 | const { |
| 9 | tagName: Tag, |
| 10 | htmlAttributes = {}, |
| 11 | } = attributes; |
| 12 | |
| 13 | const classNames = getBlockClasses( |
| 14 | 'gb-query', |
| 15 | attributes, |
| 16 | ); |
| 17 | |
| 18 | const blockProps = useBlockProps.save( |
| 19 | { |
| 20 | className: classNames.join( ' ' ).trim(), |
| 21 | ...htmlAttributes, |
| 22 | } |
| 23 | ); |
| 24 | |
| 25 | return ( |
| 26 | <Tag { ...useInnerBlocksProps.save( blockProps ) } /> |
| 27 | ); |
| 28 | } |
| 29 |