first try
This commit is contained in:
13
src/space-status/block.json
Normal file
13
src/space-status/block.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"apiVersion": 3,
|
||||
"name": "wp-spaceapi-consumer/space-status",
|
||||
"title": "Space Status",
|
||||
"description": "Show whether the space is open or closed (SpaceAPI consumer).",
|
||||
"category": "widgets",
|
||||
"icon": "info",
|
||||
"textdomain": "wp-spaceapi-consumer",
|
||||
"style": "file:./style.css",
|
||||
"editorStyle": "file:./editor.css",
|
||||
"editorScript": "file:./index.js",
|
||||
"supports": { "html": false }
|
||||
}
|
||||
0
src/space-status/editor.css
Normal file
0
src/space-status/editor.css
Normal file
12
src/space-status/index.js
Normal file
12
src/space-status/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
|
||||
registerBlockType( 'wp-spaceapi-consumer/space-status', {
|
||||
edit: () => (
|
||||
<ServerSideRender
|
||||
block="wp-spaceapi-consumer/space-status"
|
||||
/>
|
||||
),
|
||||
save: () => null, // dynamic block — markup comes from PHP
|
||||
} );
|
||||
1
src/space-status/style.css
Normal file
1
src/space-status/style.css
Normal file
@@ -0,0 +1 @@
|
||||
@import url('../wp-spaceapi-consumer-style.css');
|
||||
Reference in New Issue
Block a user