golden hour
/home/godaofbq/hardchambers.com/wp-content/plugins/table-builder-block/src/table-builder
⬆️ Go Up
Upload
File/Folder
Size
Actions
block.json
4.82 KB
Del
OK
index.js
406 B
Del
OK
save.js
873 B
Del
OK
style.scss
105 B
Del
OK
Edit: save.js
import { useBlockProps, useInnerBlocksProps, RichText, } from '@wordpress/block-editor'; export default function save( { attributes } ) { const { caption, headers, footers, hasHeader, hasFooter, isEmpty } = attributes; const blockProps = useBlockProps.save(); const innerBlocksProps = useInnerBlocksProps.save( { className: 'gkit-table__body', } ); return ( ! isEmpty && ( <figure { ...blockProps }> <table className="gkit-table"> <thead className="gkit-table__header"> <tr>{ Headers }</tr> </thead> <tbody { ...innerBlocksProps } /> <tfoot className="gkit-table__footer"> <tr>{ Footers }</tr> </tfoot> </table> { caption && ( <RichText.Content identifier="caption" tagName="figcaption" className="gkit-table__caption" value={ caption } /> ) } </figure> ) ); }
Save