Skip to content

Commit 95550ca

Browse files
lassemtAhmad Awais ⚡️
authored andcommitted
🐛 FIX: wp.editor is undefined in latest version of gutenberg. (#106)
wp.editor is undefined when using the latest version of Gutenberg. This fix makes sure the `wp.editor` is loaded before the cgb. plugin. <!-- Thank you for sending a PR! If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots! I mean that. Happy contributing! -->
1 parent f8d3a0f commit 95550ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/cgb-scripts/template/src

packages/cgb-scripts/template/src/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function <% blockNamePHPLower %>_cgb_editor_assets() {
4747
wp_enqueue_script(
4848
'<% blockNamePHPLower %>-cgb-block-js', // Handle.
4949
plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack.
50-
array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above.
50+
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above.
5151
// filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time.
5252
true // Enqueue the script in the footer.
5353
);

0 commit comments

Comments
 (0)