-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f42c7a
commit 29f0865
Showing
4 changed files
with
10 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php return array( 'dependencies' => array('wp-blocks'),'version' => '0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
(function (blocks, element, blockEditor) { | ||
(function (blocks, element) { | ||
var el = element.createElement; | ||
var useBlockProps = blockEditor.useBlockProps; | ||
|
||
blocks.registerBlockType("gutenberg-examples/minimal-block-e621a6", { | ||
title: 'minimal-block-e621a6', | ||
icon: 'smiley', // Icon used for the block from Dashicons | ||
category: 'common', // The category this block will be listed under | ||
blocks.registerBlockType("gutenberg-examples/minimal-block-no-build-e621a6", { | ||
edit: function () { | ||
return el("p", useBlockProps() , "Hello World - Block Editor"); | ||
return el("p", {} , "Hello World - Block Editor"); | ||
}, | ||
save: function () { | ||
return el("p", useBlockProps() , "Hello World - Frontend"); | ||
return el("p", {} , "Hello World - Frontend"); | ||
}, | ||
}); | ||
})(window.wp.blocks, window.wp.element, window.wp.blockEditor); | ||
})(window.wp.blocks, window.wp.element); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/block.json", | ||
"apiVersion": 2, | ||
"title": "Minimal Gutenberg Block e621a6", | ||
"name": "gutenberg-examples/minimal-block-e621a6", | ||
"apiVersion": 3, | ||
"title": "Minimal Block No Build e621a6", | ||
"name": "gutenberg-examples/minimal-block-no-build-e621a6", | ||
"category": "media", | ||
"icon": "smiley", | ||
"textdomain": "gutenberg-examples", | ||
"example": {}, | ||
"editorScript": "file:./block.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
<?php | ||
/* | ||
* Plugin Name: Minimal Gutenberg Block e621a6 | ||
* Plugin Name: Gutenberg Examples - Minimal Block No Build e621a6 | ||
* Description: This is a plugin demonstrating how to register a minimal block for the Gutenberg editor. | ||
* Version: 1.0 | ||
* Author: Gutenberg Examples | ||
*/ | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
function register_block() { | ||
register_block_type( __DIR__ ); | ||
} | ||
|
||
add_action( 'init', 'register_block' ); | ||
|
||
?> | ||
|