From 9b67c4deabc4ca3daaf22dc98180db258accdbc3 Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 12 Aug 2020 20:21:01 +0100 Subject: [PATCH] use constantt for block namespace --- README.md | 8 +++----- index.php | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4ce3f2e..3fd121c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -**TODO** - currently the block name is hardcoded to `svg` and theme is `room-vw`. -Need to use templating to create a `.php` file (based on `svg.php)` -with the correct theme/block names. - - ## Usage +Edit `index.php` and `.scss` files, so that the correct block name and +namespace are used. + ```sh npm install diff --git a/index.php b/index.php index 2440b1c..32f957e 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,8 @@ >' ) + +$block_namespace = BLOCK_NAMESPACE; $block_slug = basename( dirname( __FILE__ ) ); -// 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, $block_namespace;