/** * Specific Quote Block Editor */ import { registerBlockType } from '@wordpress/blocks'; import { TextControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { BlockEditor } from '../components/BlockEditor'; import { DisableStylingControl } from '../components/DisableStylingControl'; interface SpecificQuoteAttributes { postId: number; legacyId: number; disableaspect: boolean; } interface SpecificQuoteProps { attributes: SpecificQuoteAttributes; setAttributes: (attributes: Partial) => void; } registerBlockType('xv-random-quotes/specific-quote', { edit: (props: SpecificQuoteProps) => { const { attributes, setAttributes } = props; return ( 0 || attributes.legacyId > 0} placeholderMessage={__('Please enter a Quote ID or Legacy ID in the block settings.', 'xv-random-quotes')} > setAttributes({ postId: value ? parseInt(value) : 0 })} type="number" help={__('Enter the post ID of the quote to display', 'xv-random-quotes')} /> setAttributes({ legacyId: value ? parseInt(value) : 0 })} type="number" help={__('For quotes migrated from old version', 'xv-random-quotes')} /> setAttributes({ disableaspect: value })} /> ); }, save: () => null, // Server-side rendered });