Skip to content

Commit

Permalink
Don't attempt to register_block_type if the function does not exist!
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed Sep 20, 2018
1 parent 7974804 commit b77830b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inc/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit b77830b

Please # to comment.