diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 6ea7dd6809..c196fdee31 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1161,7 +1161,7 @@ function get_media_item( $attachment_id, $args = null ) {
else
$thumb_url = false;
- $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
+ $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($_GET['post_id']), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true );
$args = wp_parse_args( $args, $default_args );
extract( $args, EXTR_SKIP );
@@ -1992,7 +1992,6 @@ jQuery(function($){
* @return unknown
*/
function type_url_form_image() {
-
if ( !apply_filters( 'disable_captions', '' ) ) {
$caption = '
@@ -2061,13 +2060,7 @@ function type_url_form_image() {
' . __('Enter a link URL or click above for presets.') . '
-
-
- |
-
-
- |
-
+ ' . _insert_into_post_button('image') . '
';
@@ -2098,12 +2091,7 @@ function type_url_form_audio() {
|
| ' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . ' |
-
- |
-
-
- |
-
+ ' . _insert_into_post_button('audio') . '
';
}
@@ -2133,12 +2121,7 @@ function type_url_form_video() {
|
| ' . __('Link text, e.g. “Lucy on YouTube“') . ' |
-
- |
-
-
- |
-
+ ' . _insert_into_post_button('video') . '
';
}
@@ -2168,14 +2151,34 @@ function type_url_form_file() {
|
| ' . __('Link text, e.g. “Ransom Demands (PDF)”') . ' |
+ ' . _insert_into_post_button('file') . '
+
+';
+}
+
+
+function _insert_into_post_button($type) {
+ if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') )
+ return '';
+
+ if ( 'image' == $type )
+ return '
+
+ |
+
+
+ |
+
+ ';
+
+ return '
|
|
-
-';
+ ';
}
/**
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index b0149e608f..844e8991e3 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -1144,7 +1144,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
global $content_width, $_wp_additional_image_sizes;
- $set_thumbnail_link = '%s
';
+ $set_thumbnail_link = '%s
';
$content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {