mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Editor: Allow registration of blocks that include assets from within a theme
Fixes the issue when you register blocks with `block.json` in your theme. There is no longer an assets's URL error because it resolves correctly in relation to the theme where it is located. Props fabiankaegy, ocean90, whoisnegrello, audrasjb, peterwilsoncc, Fixes #54647, #55513. git-svn-id: https://develop.svn.wordpress.org/trunk@53091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"title": "Example Theme Block",
|
||||
"name": "block-theme/example-block",
|
||||
"description": "Custom block registered from within a theme",
|
||||
"editorScript": "file:./index.js",
|
||||
"style": "file:./style.css"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/* Test CSS file - RTL version */
|
||||
@@ -0,0 +1 @@
|
||||
/* Test CSS file */
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'dependencies' => array( 'wp-element', 'wp-blocks' ),
|
||||
'version' => 'test',
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
/* Test JavaScript file. */
|
||||
@@ -0,0 +1 @@
|
||||
/* Test CSS file - RTL version */
|
||||
@@ -0,0 +1 @@
|
||||
/* Test CSS file */
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'dependencies' => array( 'wp-element', 'wp-blocks' ),
|
||||
'version' => 'test',
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
/* Test JavaScript file. */
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
add_action( 'init', 'register_theme_blocks' );
|
||||
|
||||
function register_theme_blocks() {
|
||||
register_block_type( __DIR__ . 'blocks/example-block' );
|
||||
}
|
||||
Reference in New Issue
Block a user