block.json
1 year ago
edit.js
1 year ago
index-min.js
1 year ago
index.js
1 year ago
save.js
1 year ago
save.js
24 lines
| 1 | /** |
| 2 | * React hook that is used to mark the block wrapper element. |
| 3 | * It provides all the necessary props like the class name. |
| 4 | * |
| 5 | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops |
| 6 | */ |
| 7 | import { useBlockProps } from '@wordpress/block-editor'; |
| 8 | |
| 9 | /** |
| 10 | * The save function defines the way in which the different attributes should |
| 11 | * be combined into the final markup, which is then serialized by the block |
| 12 | * editor into `post_content`. |
| 13 | * |
| 14 | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save |
| 15 | * |
| 16 | * @param {Object} props Properties passed to the function. |
| 17 | * @param {Object} props.attributes Available block attributes. |
| 18 | * @return {WPElement} Element to render. |
| 19 | */ |
| 20 | export default function save( { attributes } ) { |
| 21 | const blockProps = useBlockProps.save(); |
| 22 | return <div { ...blockProps }></div>; |
| 23 | } |
| 24 |