From 651a1a6e0d1019e5d7da33307db974b0d7bc7c28 Mon Sep 17 00:00:00 2001 From: Lasse Mejlvang Tvedt Date: Wed, 21 Nov 2018 14:39:12 +0100 Subject: [PATCH] This fixes wp.editor undefined wp.editor is undefined when using the latest version of Gutenberg. This fix makes sure the `wp.editor` is loaded before the cgb. plugin. --- packages/cgb-scripts/template/src/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cgb-scripts/template/src/init.php b/packages/cgb-scripts/template/src/init.php index 3edb775f..cff34020 100644 --- a/packages/cgb-scripts/template/src/init.php +++ b/packages/cgb-scripts/template/src/init.php @@ -47,7 +47,7 @@ function <% blockNamePHPLower %>_cgb_editor_assets() { wp_enqueue_script( '<% blockNamePHPLower %>-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. - array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above. + array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. true // Enqueue the script in the footer. );