utils
1 week ago
block.json
2 months ago
edit.js
1 week ago
icon.svg
2 months ago
index.js
2 months ago
index.php
2 months ago
save.js
2 months ago
style.scss
1 week ago
save.js
23 lines
| 1 | import { useBlockProps } from '@wordpress/block-editor'; |
| 2 | |
| 3 | export default function save({ attributes }) { |
| 4 | const { iframeCode } = attributes; |
| 5 | |
| 6 | const updatedIframeCode = iframeCode.replace(/<a /g, '<a rel="noopener" '); |
| 7 | |
| 8 | const blockProps = useBlockProps.save({ |
| 9 | className: 'vk-visual-embed', |
| 10 | }); |
| 11 | |
| 12 | return ( |
| 13 | <div {...blockProps}> |
| 14 | {iframeCode && ( |
| 15 | <div |
| 16 | className="vk-visual-embed-preview" |
| 17 | dangerouslySetInnerHTML={{ __html: updatedIframeCode }} |
| 18 | /> |
| 19 | )} |
| 20 | </div> |
| 21 | ); |
| 22 | } |
| 23 |