Skip to content

Commit 2b5510f

Browse files
init
0 parents  commit 2b5510f

14 files changed

+12167
-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/block.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 2,
4+
"name": "my-block/image-wrapper",
5+
"version": "0.1.0",
6+
"title": "Image Wrapper",
7+
"category": "widgets",
8+
"icon": "smiley",
9+
"description": "Block that wraps an image with and disables its Image Dimensions controls.",
10+
"supports": {
11+
"html": false
12+
},
13+
"attributes": {
14+
"allowResize": {
15+
"type": "boolean",
16+
"default": false
17+
}
18+
},
19+
"providesContext": {
20+
"allowResize": "allowResize"
21+
},
22+
"textdomain": "image-wrapper",
23+
"editorScript": "file:./index.js",
24+
"editorStyle": "file:./index.css",
25+
"style": "file:./style-index.css"
26+
}

build/index.asset.php

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

build/index.js

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

build/index.js.map

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

image-wrapper.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Plugin Name: Image Wrapper
4+
* Description: Image wrapper that disables Image Dimensions panel
5+
* Requires at least: 6.1
6+
* Requires PHP: 7.0
7+
* Version: 0.1.0
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: image-wrapper
12+
*
13+
* @package image-wrapper
14+
*/
15+
16+
/**
17+
* Registers the block using the metadata loaded from the `block.json` file.
18+
* Behind the scenes, it registers also all assets so they can be enqueued
19+
* through the block editor in the corresponding context.
20+
*
21+
* @see https://developer.wordpress.org/reference/functions/register_block_type/
22+
*/
23+
function create_block_image_wrapper_block_init() {
24+
register_block_type( __DIR__ . '/build' );
25+
}
26+
add_action( 'init', 'create_block_image_wrapper_block_init' );

0 commit comments

Comments
 (0)