From 334332a64f50562efd49139dfcd8e005ad77b443 Mon Sep 17 00:00:00 2001 From: ray Date: Sun, 16 Aug 2020 18:50:04 +0100 Subject: [PATCH] refactor block name, slug, title into variables --- src/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 7492334..2a0cb86 100644 --- a/src/index.js +++ b/src/index.js @@ -4,9 +4,13 @@ import './editor.scss'; import { registerBlockType } from '@wordpress/blocks'; import { __ } from '@wordpress/i18n'; +const NAMESPACE = ''; +const SLUG = ''; +const BLOCK_TITLE= ''; -registerBlockType( '/', { // FIXME replace , , - title: __( '', '' ), // FIXME replace , + +registerBlockType( `${NAMESPACE}/${SLUG}`, { + title: __( BLOCK_TITLE, SLUG), category: 'widgets', @@ -20,7 +24,7 @@ registerBlockType( '/', { // FIXME replace , '), // FIXME replace + default: __('A default name', NAMESPACE), }, }