Skip to content

Commit

Permalink
Ensure the editor module is loaded before third party plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 4, 2018
1 parent 5e9b3df commit 40920e9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 );

0 comments on commit 40920e9

Please sign in to comment.