Skip to content

Commit 12d9ce8

Browse files
committed
initial commit
0 parents  commit 12d9ce8

25 files changed

+21186
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[*.{yml,yaml}]
17+
indent_style = space
18+
indent_size = 2

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Coverage directory used by tools like istanbul
9+
coverage
10+
11+
# Compiled binary addons (https://nodejs.org/api/addons.html)
12+
build/Release
13+
14+
# Dependency directories
15+
node_modules/
16+
17+
# Optional npm cache directory
18+
.npm
19+
20+
# Optional eslint cache
21+
.eslintcache
22+
23+
# Output of `npm pack`
24+
*.tgz
25+
26+
# Output of `wp-scripts plugin-zip`
27+
*.zip
28+
29+
# dotenv environment variables file
30+
.env

build/blocks-manifest.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
// This file is generated. Do not modify it manually.
3+
return array(
4+
'movable' => array(
5+
'$schema' => 'https://schemas.wp.org/trunk/block.json',
6+
'apiVersion' => 3,
7+
'name' => 'create-block/movable',
8+
'version' => '0.1.0',
9+
'title' => 'Movable',
10+
'category' => 'widgets',
11+
'icon' => 'smiley',
12+
'description' => 'Example block scaffolded with Create Block tool.',
13+
'example' => array(
14+
15+
),
16+
'supports' => array(
17+
'html' => false
18+
),
19+
'textdomain' => 'movable',
20+
'editorScript' => 'file:./index.js',
21+
'editorStyle' => 'file:./index.css',
22+
'style' => 'file:./style-index.css',
23+
'viewScript' => 'file:./view.js'
24+
)
25+
);

build/movable/block.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "create-block/movable",
5+
"version": "0.1.0",
6+
"title": "Movable",
7+
"category": "widgets",
8+
"icon": "smiley",
9+
"description": "Example block scaffolded with Create Block tool.",
10+
"example": {},
11+
"supports": {
12+
"html": false
13+
},
14+
"textdomain": "movable",
15+
"editorScript": "file:./index.js",
16+
"editorStyle": "file:./index.css",
17+
"style": "file:./style-index.css",
18+
"viewScript": "file:./view.js"
19+
}

build/movable/index-rtl.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.wp-block-create-block-movable{border:1px dotted red}

build/movable/index.asset.php

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'aa18e796fd6204fc08c8');

build/movable/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.wp-block-create-block-movable{border:1px dotted red}

build/movable/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/movable/style-index-rtl.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.wp-block-create-block-movable{background-color:#21759b;color:#fff;padding:2px}

build/movable/style-index.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.wp-block-create-block-movable{background-color:#21759b;color:#fff;padding:2px}

build/movable/view.asset.php

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array(), 'version' => 'a525d5c1dddb375f3973');

build/movable/view.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

movable.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Plugin Name: Movable
4+
* Description: Example block scaffolded with Create Block tool.
5+
* Version: 0.1.0
6+
* Requires at least: 6.7
7+
* Requires PHP: 7.4
8+
* Author: The WordPress Contributors
9+
* License: GPL-2.0-or-later
10+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
11+
* Text Domain: movable
12+
*
13+
* @package CreateBlock
14+
*/
15+
16+
if ( ! defined( 'ABSPATH' ) ) {
17+
exit; // Exit if accessed directly.
18+
}
19+
20+
/**
21+
* Registers the block using the metadata loaded from the `block.json` file.
22+
* Behind the scenes, it registers also all assets so they can be enqueued
23+
* through the block editor in the corresponding context.
24+
*
25+
* @see https://developer.wordpress.org/reference/functions/register_block_type/
26+
*/
27+
function create_block_movable_block_init() {
28+
if ( function_exists( 'wp_register_block_types_from_metadata_collection' ) ) { // Function introduced in WordPress 6.8.
29+
wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
30+
} else {
31+
if ( function_exists( 'wp_register_block_metadata_collection' ) ) { // Function introduced in WordPress 6.7.
32+
wp_register_block_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
33+
}
34+
$manifest_data = require __DIR__ . '/build/blocks-manifest.php';
35+
foreach ( array_keys( $manifest_data ) as $block_type ) {
36+
register_block_type( __DIR__ . "/build/{$block_type}" );
37+
}
38+
}
39+
}
40+
add_action( 'init', 'create_block_movable_block_init' );

0 commit comments

Comments
 (0)