diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php
index 8ee85fc1f..04b0df959 100644
--- a/wp-admin/async-upload.php
+++ b/wp-admin/async-upload.php
@@ -30,6 +30,7 @@ if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
echo get_media_item($id, array( 'send' => false, 'delete' => false ));
} else {
+ add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2);
echo get_media_item($id);
}
exit;
@@ -53,4 +54,4 @@ else {
echo apply_filters("async_upload_{$type}", $id);
}
-?>
\ No newline at end of file
+?>
diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css
index 92de6d726..61b89bda0 100644
--- a/wp-admin/css/colors-classic.css
+++ b/wp-admin/css/colors-classic.css
@@ -1577,3 +1577,7 @@ fieldset.inline-edit-col-right .inline-edit-col {
#header-logo {
background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
}
+
+input[readonly] {
+ background-color: #eee;
+}
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index a5c8ceb2d..dbded4406 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -1577,3 +1577,7 @@ fieldset.inline-edit-col-right .inline-edit-col {
#header-logo {
background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
}
+
+input[readonly] {
+ background-color: #eee;
+}
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index d157092db..91f136dd1 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -838,6 +838,9 @@ function image_link_input_fields($post, $url_type='') {
function image_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
$form_fields['post_title']['required'] = true;
+ $file = wp_get_attachment_url($post->ID);
+
+ $form_fields['image_url']['value'] = $file;
$form_fields['post_excerpt']['label'] = __('Caption');
$form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
@@ -871,6 +874,11 @@ function media_single_attachment_fields_to_edit( $form_fields, $post ) {
return $form_fields;
}
+function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
+ unset($form_fields['image_url']);
+ return $form_fields;
+}
+
/**
* {@internal Missing Short Description}}
*
@@ -943,6 +951,8 @@ function get_attachment_fields_to_edit($post, $errors = null) {
if ( is_array($post) )
$post = (object) $post;
+ $image_url = wp_get_attachment_url($post->ID);
+
$edit_post = sanitize_post($post, 'edit');
$form_fields = array(
@@ -969,6 +979,13 @@ function get_attachment_fields_to_edit($post, $errors = null) {
'label' => __('Order'),
'value' => $edit_post->menu_order
),
+ 'image_url' => array(
+ 'label' => __('File URL'),
+ 'input' => 'html',
+ 'html' => "
",
+ 'value' => $edit_post->post_url,
+ 'helps' => __('Location of the uploaded file.'),
+ )
);
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
@@ -1371,6 +1388,7 @@ jQuery(function($){
'.wp_specialchars($id->get_error_message()).'';
@@ -1537,6 +1555,7 @@ jQuery(function($){