rename variable

This commit is contained in:
Ray Elliott 2020-08-12 19:52:02 +01:00
parent 9c6f61cc09
commit bcd553f4f0
1 changed files with 4 additions and 4 deletions

View File

@ -1,10 +1,10 @@
<?php
$block_slug = basename( dirname( __FILE__ ) );
$theme_slug = get_option( 'stylesheet' );
// TODO calculate this correctly whether this file is within a theme or plugin
$block_namespace = get_option( 'stylesheet' );
add_action( 'init', function() {
global $block_slug, $theme_slug;
global $block_slug, $block_namespace;
if ( ! function_exists( 'register_block_type' ) ) {
return;
@ -39,7 +39,7 @@ add_action( 'init', function() {
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_style' => "{$block_slug}-block-editor",
'style' => "{$block_slug}-block",