Skip to content

Commit b77830b

Browse files
committed
Don't attempt to register_block_type if the function does not exist!
1 parent 7974804 commit b77830b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/block.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
* @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
1313
*/
1414
function pym_block_init() {
15+
if ( ! function_exists( 'register_block_type' ) ) {
16+
// Gutenberg is not active.
17+
return false;
18+
}
19+
1520
$dir = dirname( dirname( __FILE__ ) );
1621

1722
$block_js = 'js/block.js';

0 commit comments

Comments
 (0)