a working react/php dynamic wordpress block example integrated with the Vite build process
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"apiVersion": 3,
|
||||
"name": "badegg/example",
|
||||
"title": "Example",
|
||||
"category": "badegg",
|
||||
"icon": "cover-image",
|
||||
"description": "This is an example of a custom Wordpress Block created using the offical method.",
|
||||
"editorScript": "example-editor-script",
|
||||
"editorStyle": "example-editor-style",
|
||||
"style": "example-style",
|
||||
"render": "resources/blocks/example/render.blade.php"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.block-badegg-example-editor {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
|
||||
registerBlockType('badegg/example', {
|
||||
apiVersion: 3, // optional in JS, primarily in block.json
|
||||
edit() {
|
||||
return (
|
||||
<section className="block-badegg-example">
|
||||
<h2>Bad Egg Block Example</h2>
|
||||
</section>
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
<section class="block-badegg-example">
|
||||
<h2>Bad Egg Example Block (Blade)</h2>
|
||||
</section>
|
||||
@@ -0,0 +1,3 @@
|
||||
.block-badegg-hero {
|
||||
display: block;
|
||||
}
|
||||
Reference in New Issue
Block a user