diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 6be0c86550..a6a37b6f98 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1602,9 +1602,11 @@ function wp_ajax_upload_attachment() { $wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'], false ); if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) { echo json_encode( array( - 'success' => false, - 'message' => __( 'The uploaded file is not a valid image. Please try again.' ), - 'filename' => $_FILES['async-upload']['name'], + 'success' => false, + 'data' => array( + 'message' => __( 'The uploaded file is not a valid image. Please try again.' ), + 'filename' => $_FILES['async-upload']['name'], + ) ) ); wp_die(); @@ -1615,9 +1617,11 @@ function wp_ajax_upload_attachment() { if ( is_wp_error( $attachment_id ) ) { echo json_encode( array( - 'success' => false, - 'message' => $attachment_id->get_error_message(), - 'filename' => $_FILES['async-upload']['name'], + 'success' => false, + 'data' => array( + 'message' => $attachment_id->get_error_message(), + 'filename' => $_FILES['async-upload']['name'], + ) ) ); wp_die(); diff --git a/wp-includes/css/media-views.css b/wp-includes/css/media-views.css index f350c816e3..d42edf1ad0 100644 --- a/wp-includes/css/media-views.css +++ b/wp-includes/css/media-views.css @@ -790,7 +790,9 @@ .media-uploader-status { position: relative; + margin: 0 auto; padding-bottom: 10px; + max-width: 400px; } .media-sidebar .media-uploader-status { @@ -842,7 +844,6 @@ } .upload-errors .upload-error { - max-width: 400px; margin: 8px auto 0 auto; padding: 8px; border: 1px #c00 solid; @@ -868,6 +869,7 @@ display: block; padding-top: 8px; color: #b44; + word-wrap: break-word; } .uploader-window {