From b77830b658c4aa325da6d0bff5fa7c3cb01cde54 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Thu, 20 Sep 2018 19:50:18 -0400 Subject: [PATCH] Don't attempt to register_block_type if the function does not exist! --- inc/block.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/block.php b/inc/block.php index fe20aee..fa90b2d 100644 --- a/inc/block.php +++ b/inc/block.php @@ -12,6 +12,11 @@ * @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts */ function pym_block_init() { + if ( ! function_exists( 'register_block_type' ) ) { + // Gutenberg is not active. + return false; + } + $dir = dirname( dirname( __FILE__ ) ); $block_js = 'js/block.js';