Skip to content

Commit

Permalink
Defer until wp.api has initialized to createEditorInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jun 19, 2017
1 parent f47f55c commit 7780764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function gutenberg_scripts_and_styles( $hook ) {
);

// Initialize the editor.
wp_add_inline_script( 'wp-editor', 'wp.editor.createEditorInstance( \'editor\', window._wpGutenbergPost );' );
wp_add_inline_script( 'wp-editor', 'wp.api.init().done( function() { wp.editor.createEditorInstance( \'editor\', window._wpGutenbergPost ); } );' );

/**
* Styles
Expand Down

0 comments on commit 7780764

Please sign in to comment.