do not use global variables

This commit is contained in:
Ray Elliott 2020-08-16 17:27:19 +01:00
parent 6bb91ed855
commit 1c9ddd2507
1 changed files with 3 additions and 4 deletions

View File

@ -1,9 +1,8 @@
<?php
$block_namespace = '<<INSERT BLOCK NAMESPACE HERE>>';
$block_slug = basename( dirname( __FILE__ ) );
add_action( 'init', function() {
$block_namespace = '<<INSERT BLOCK NAMESPACE HERE>>';
$block_slug = '<<INSERT BLOCK SLUG HERE>>';
global $block_slug, $block_namespace;
if ( ! function_exists( 'register_block_type' ) ) {