diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css
index 0128cdef12..7ffffda75a 100644
--- a/wp-admin/css/wp-admin.css
+++ b/wp-admin/css/wp-admin.css
@@ -4150,23 +4150,26 @@ borger color while dragging a file over the uploader drop area */
margin: 8px 0;
}
+.post-php .imgedit-wrap table {
+ width: 100%;
+}
+
.describe .imgedit-wrap table td,
.wp_attachment_holder .imgedit-wrap table td {
vertical-align: top;
padding-top: 0;
}
-.imgedit-wrap p,
-.describe .imgedit-wrap table td {
- font-size: 11px;
- line-height: 18px;
-}
-
.describe .imgedit-wrap table td.imgedit-settings {
padding: 0 5px;
}
+.wp_attachment_holder .imgedit-wrap table td.imgedit-settings {
+ width: 250px;
+}
+
td.imgedit-settings input {
+ margin-top: 0;
vertical-align: middle;
}
@@ -4349,19 +4352,10 @@ td.imgedit-settings input {
margin-bottom: 8px;
}
-.imgedit-help ul li {
- font-size: 11px;
-}
-
a.imgedit-help-toggle {
text-decoration: none;
}
-#wpbody-content .imgedit-response div {
- width: 600px;
- margin: 8px;
-}
-
.form-table td.imgedit-response {
padding: 0;
}
@@ -4389,8 +4383,8 @@ span.imgedit-scale-warn {
.imgedit-group {
border-width: 1px;
border-style: solid;
- -webkit-border-radius: 8px;
- border-radius: 8px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
margin-bottom: 8px;
padding: 2px 10px;
}
diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php
index 5c3c851540..f0baccaec1 100644
--- a/wp-admin/includes/image-edit.php
+++ b/wp-admin/includes/image-edit.php
@@ -191,7 +191,7 @@ function wp_image_editor($post_id, $msg = false) {
-
diff --git a/wp-includes/css/media-views.css b/wp-includes/css/media-views.css
index b24b3dbb30..1e0b40656f 100644
--- a/wp-includes/css/media-views.css
+++ b/wp-includes/css/media-views.css
@@ -1308,6 +1308,7 @@
float: left;
max-width: 120px;
max-height: 120px;
+ margin-top: 5px;
margin-right: 10px;
margin-bottom: 5px;
}
@@ -1347,17 +1348,30 @@
max-width: 100%;
}
-.attachment-info .delete-attachment a {
- color: red;
- padding: 2px 4px;
- margin: -2px -4px;
+.attachment-info .edit-attachment,
+.attachment-info .refresh-attachment,
+.attachment-info .delete-attachment {
+ display: block;
text-decoration: none;
white-space: nowrap;
}
-.attachment-info .delete-attachment a:hover {
- color: #fff;
- background: red;
+.attachment-info .refresh-attachment,
+.attachment-details.needs-refresh .attachment-info .edit-attachment {
+ display: none;
+}
+
+.attachment-details.needs-refresh .attachment-info .refresh-attachment,
+.attachment-info .edit-attachment {
+ display: block;
+}
+
+.attachment-info .delete-attachment {
+ color: #bc0b0b;
+}
+
+.attachment-info .delete-attachment:hover {
+ color: red;
}
/**
diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js
index 3d63c59f56..aef05dd11b 100644
--- a/wp-includes/js/media-views.js
+++ b/wp-includes/js/media-views.js
@@ -4021,7 +4021,9 @@
'change [data-setting] input': 'updateSetting',
'change [data-setting] select': 'updateSetting',
'change [data-setting] textarea': 'updateSetting',
- 'click .delete-attachment': 'deleteAttachment'
+ 'click .delete-attachment': 'deleteAttachment',
+ 'click .edit-attachment': 'editAttachment',
+ 'click .refresh-attachment': 'refreshAttachment'
},
initialize: function() {
@@ -4038,11 +4040,21 @@
return this;
},
- deleteAttachment: function(event) {
+ deleteAttachment: function( event ) {
event.preventDefault();
if ( confirm( l10n.warnDelete ) )
this.model.destroy();
+ },
+
+ editAttachment: function( event ) {
+ this.$el.addClass('needs-refresh');
+ },
+
+ refreshAttachment: function( event ) {
+ this.$el.removeClass('needs-refresh');
+ event.preventDefault();
+ this.model.fetch();
}
});
diff --git a/wp-includes/media.php b/wp-includes/media.php
index b3594f5c8f..7ab34f942b 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -1337,10 +1337,13 @@ function wp_prepare_attachment_for_js( $attachment ) {
'update' => false,
'delete' => false,
),
+ 'editLink' => false,
);
- if ( current_user_can( 'edit_post', $attachment->ID ) )
+ if ( current_user_can( 'edit_post', $attachment->ID ) ) {
$response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID );
+ $response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' );
+ }
if ( current_user_can( 'delete_post', $attachment->ID ) )
$response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
@@ -1703,14 +1706,22 @@ function wp_print_media_templates() {
{{ data.filename }}
{{ data.dateFormatted }}
- <# if ( 'image' === data.type && ! data.uploading && data.width && data.height ) { #>
-
{{ data.width }} × {{ data.height }}
+
+ <# if ( 'image' === data.type && ! data.uploading ) { #>
+ <# if ( data.width && data.height ) { #>
+
{{ data.width }} × {{ data.height }}
+ <# } #>
+
+ <# if ( data.can.save ) { #>
+
+
+ <# } #>
<# } #>
+
<# if ( ! data.uploading && data.can.remove ) { #>
-
+
<# } #>
+
<# if ( data.compat && data.compat.meta ) { #>
{{{ data.compat.meta }}}