| 12345678910111213141516171819202122232425262728 |
- import { registerBlockType } from '@wordpress/blocks';
- import metadata from './block.json';
- import { useBlockProps, RichText } from '@wordpress/block-editor';
- import ServerSideRender from '@wordpress/server-side-render';
- registerBlockType(metadata.name, {
- edit: () => {
- return (
- <div { ...useBlockProps() }>
- <ServerSideRender
- block="tsu-plugins/newsletter"
- // attributes={ attributes }
- urlQueryArgs={ {
- // Let the render callback knows that this is an editor preview.
- preview: 1,
- // In the preview mode, get_the_ID() does not work (it returns a
- // `false`), hence let's send the post ID.
- // post_id: context.postId,
- } }
- />
- </div>
- );
- },
- save: () => {
- return ("Tutaj renderujemy blok newsletter.");
- }
- });
|