rename variable
This commit is contained in:
parent
9c6f61cc09
commit
bcd553f4f0
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
$block_slug = basename( dirname( __FILE__ ) );
|
$block_slug = basename( dirname( __FILE__ ) );
|
||||||
|
// TODO calculate this correctly whether this file is within a theme or plugin
|
||||||
$theme_slug = get_option( 'stylesheet' );
|
$block_namespace = get_option( 'stylesheet' );
|
||||||
|
|
||||||
add_action( 'init', function() {
|
add_action( 'init', function() {
|
||||||
global $block_slug, $theme_slug;
|
global $block_slug, $block_namespace;
|
||||||
|
|
||||||
if ( ! function_exists( 'register_block_type' ) ) {
|
if ( ! function_exists( 'register_block_type' ) ) {
|
||||||
return;
|
return;
|
||||||
|
@ -39,7 +39,7 @@ add_action( 'init', function() {
|
||||||
filemtime( "$dir/$style_css" )
|
filemtime( "$dir/$style_css" )
|
||||||
);
|
);
|
||||||
|
|
||||||
register_block_type( "$theme_slug/$block_slug", array(
|
register_block_type( "$block_namespace/$block_slug", array(
|
||||||
'editor_script' => "{$block_slug}-block-editor",
|
'editor_script' => "{$block_slug}-block-editor",
|
||||||
'editor_style' => "{$block_slug}-block-editor",
|
'editor_style' => "{$block_slug}-block-editor",
|
||||||
'style' => "{$block_slug}-block",
|
'style' => "{$block_slug}-block",
|
||||||
|
|
Loading…
Reference in New Issue