diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css index d9f4ba2951..5358027920 100644 --- a/wp-admin/css/wp-admin.css +++ b/wp-admin/css/wp-admin.css @@ -6216,7 +6216,7 @@ h3:hover .edit-box { } #dashboard_quick_press .wp-media-buttons { - margin: 0 0 .2em 8px; + margin: 0 0 .2em 1px; padding: 0; } diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index ad831555a1..1c9921a78e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -17,13 +17,11 @@ if ( wp_is_mobile() ) if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) { add_thickbox(); - wp_enqueue_script('media-upload'); - wp_enqueue_script( 'media-views' ); + + wp_enqueue_script( 'media-upload' ); wp_enqueue_style( 'media-views' ); wp_plupload_default_settings(); add_action( 'admin_footer', 'wp_print_media_templates' ); - - wp_enqueue_script( 'mce-view' ); } /** diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 594cfe0d19..1d12d33237 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -377,6 +377,11 @@ document.body.className = document.body.className.replace('no-js', 'js'); * @param string $editor_id */ function media_buttons($editor_id = 'content') { + wp_enqueue_script( 'media-upload' ); + wp_enqueue_style( 'media-views' ); + wp_plupload_default_settings(); + add_action( 'admin_footer', 'wp_print_media_templates' ); + $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); $img = ''; diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index bb1815505c..aec6412131 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -148,5 +148,5 @@ var tb_position; } }; - $( wp.mce.media.init ) + $( wp.mce.media.init ); }(jQuery)); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 451ea2cb34..67626f8d2a 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -297,7 +297,7 @@ function wp_default_scripts( &$scripts ) { 'type' => 'characters' == _x( 'words', 'word count: words or characters?' ) ? 'c' : 'w', ) ); - $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'mce-view' ), false, 1 ); + $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'mce-view', 'media-views' ), false, 1 ); $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r6', 1 );