WordPress.org

Make WordPress Core

Changeset 22954


Ignore:
Timestamp:
11/30/2012 03:40:09 PM (5 years ago)
Author:
ryan
Message:

Properly pass WordPress uploading errors to wp.Uploader.

Props koopersmith
fixes #22655

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r22929 r22954  
    16031603        if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
    16041604            echo json_encode( array(
    1605                 'success'  => false,
    1606                 'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
    1607                 'filename' => $_FILES['async-upload']['name'],
     1605                'success' => false,
     1606                'data'    => array(
     1607                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
     1608                    'filename' => $_FILES['async-upload']['name'],
     1609                )
    16081610            ) );
    16091611
     
    16161618    if ( is_wp_error( $attachment_id ) ) {
    16171619        echo json_encode( array(
    1618             'success'  => false,
    1619             'message'  => $attachment_id->get_error_message(),
    1620             'filename' => $_FILES['async-upload']['name'],
     1620            'success' => false,
     1621            'data'    => array(
     1622                'message'  => $attachment_id->get_error_message(),
     1623                'filename' => $_FILES['async-upload']['name'],
     1624            )
    16211625        ) );
    16221626
  • trunk/wp-includes/css/media-views.css

    r22945 r22954  
    791791.media-uploader-status {
    792792    position: relative;
     793    margin: 0 auto;
    793794    padding-bottom: 10px;
     795    max-width: 400px;
    794796}
    795797
     
    843845
    844846.upload-errors .upload-error {
    845     max-width: 400px;
    846847    margin: 8px auto 0 auto;
    847848    padding: 8px;
     
    869870    padding-top: 8px;
    870871    color: #b44;
     872    word-wrap: break-word;
    871873}
    872874
Note: See TracChangeset for help on using the changeset viewer.