@wordpress/block-library
Version:
Block library for the WordPress editor.
11 lines (8 loc) • 446 B
JavaScript
import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';
export default function save( { attributes: { tagName: Tag, legacy } } ) {
const blockProps = useBlockProps.save();
const innerBlocksProps = useInnerBlocksProps.save( blockProps );
// The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner
// blocks, so nothing is saved in that case.
return legacy ? null : <Tag { ...innerBlocksProps } />;
}