Skip to content

Commit 31ab51c

Browse files
committed
Adding example of plugin to suport wp dev blog article
0 parents  commit 31ab51c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+19491
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
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

Lines changed: 30 additions & 0 deletions
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

.wp-env.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"core": null,
3+
"plugins": [
4+
".",
5+
"https://downloads.wordpress.org/plugin/gutenberg.zip",
6+
"https://downloads.wordpress.org/plugin/plugin-check.zip"
7+
],
8+
"themes": ["https://downloads.wordpress.org/theme/twentytwentyfour.zip"],
9+
"config": {
10+
"WP_DEBUG": true,
11+
"WP_DEBUG_LOG": true
12+
}
13+
}

build/blocks/block-four/block.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "create-block/block-four",
5+
"version": "0.1.0",
6+
"title": "Block Four",
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": "wp-multi-block",
15+
"render": "file:./render.php"
16+
}

build/blocks/block-four/render.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p <?php echo get_block_wrapper_attributes(); ?>>
2+
<?php esc_html_e( 'Block Four – hello from a dynamic block!', 'block-four' ); ?>
3+
</p>

build/blocks/block-one/block.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "create-block/block-one",
5+
"version": "0.1.0",
6+
"title": "Block One",
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": "wp-multi-block"
15+
}

build/blocks/block-three/block.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "create-block/block-three",
5+
"version": "0.1.0",
6+
"title": "Block Three",
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": "wp-multi-block",
15+
"render": "file:./render.php"
16+
}

build/blocks/block-three/render.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p <?php echo get_block_wrapper_attributes(); ?>>
2+
<?php esc_html_e( 'Block Three – hello from a dynamic block!', 'block-three' ); ?>
3+
</p>

build/blocks/block-two/block.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "create-block/block-two",
5+
"version": "0.1.0",
6+
"title": "Block Two",
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": "wp-multi-block"
15+
}

build/multi-block-editor-rtl.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/multi-block-editor.asset.php

Lines changed: 1 addition & 0 deletions
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' => 'ca40107186329e23129e');

build/multi-block-editor.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/multi-block-editor.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/multi-block-frontend.asset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array(), 'version' => 'ac4b6fb1caceb28c712c');

build/multi-block-frontend.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("frontend test");
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.wp-block-create-block-block-one{background-color:#21759b;color:#fff;padding:2px}
2+
.wp-block-create-block-block-two{background-color:#21759b;color:#fff;padding:2px}
3+
.wp-block-create-block-block-three{background-color:#21759b;color:#fff;padding:2px}
4+
.wp-block-create-block-block-four{background-color:#21759b;color:#fff;padding:2px}

build/style-multi-block-editor.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.wp-block-create-block-block-one{background-color:#21759b;color:#fff;padding:2px}
2+
.wp-block-create-block-block-two{background-color:#21759b;color:#fff;padding:2px}
3+
.wp-block-create-block-block-three{background-color:#21759b;color:#fff;padding:2px}
4+
.wp-block-create-block-block-four{background-color:#21759b;color:#fff;padding:2px}

0 commit comments

Comments
 (0)