Skip to content

Commit

Permalink
Initialize media library with auto-draft post
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jul 20, 2017
1 parent e5c37a2 commit 05f0736
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,6 @@ function gutenberg_editor_scripts_and_styles( $hook ) {

$is_demo = isset( $page_match[2] );

/**
* Scripts
*/
wp_enqueue_media();
wp_enqueue_editor();

wp_add_inline_script(
'editor', 'window.wp.oldEditor = window.wp.editor;', 'after'
);
Expand Down Expand Up @@ -568,6 +562,12 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
// Initialize the editor.
wp_add_inline_script( 'wp-editor', 'wp.api.init().done( function() { wp.editor.createEditorInstance( \'editor\', window._wpGutenbergPost ); } );' );

/**
* Scripts
*/
wp_enqueue_media( array( 'post' => $post_to_edit['id'] ) );
wp_enqueue_editor();

/**
* Styles
*/
Expand Down

0 comments on commit 05f0736

Please sign in to comment.