diff --git a/lib/client-assets.php b/lib/client-assets.php index 06a60de0fdd824..a9d8792db32fe1 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -289,8 +289,7 @@ function gutenberg_register_scripts_and_styles() { 'tinymce-latest-paste', 'tinymce-latest-table', ), - filemtime( gutenberg_dir_path() . 'editor/build/index.js' ), - true + filemtime( gutenberg_dir_path() . 'editor/build/index.js' ) ); wp_register_script( @@ -1017,3 +1016,14 @@ function gutenberg_editor_scripts_and_styles( $hook ) { */ do_action( 'enqueue_block_editor_assets' ); } + +/** + * Ensure the editor module is loaded before third party plugins. + * + * Remove this in Gutenberg 3.1 + */ +function polyfill_blocks_module_in_scripts() { + wp_enqueue_script( 'wp-editor' ); +} + +add_action( 'enqueue_block_editor_assets', 'polyfill_blocks_module_in_scripts', 9 );