Make WordPress Core


Ignore:
Timestamp:
05/23/2010 10:59:52 AM (14 years ago)
Author:
dd32
Message:

Better display handling of error messages during swfupload uploading. Fixes #12225

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/async-upload.php

    r14139 r14816  
    4444
    4545$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
    46 if (is_wp_error($id)) {
    47     echo '<div id="media-upload-error">'.esc_html($id->get_error_message()).'</div>';
     46if ( is_wp_error($id) ) {
     47    echo '<div class="error-div">
     48    <a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __('Dismiss') . '</a>
     49    <strong>' . sprintf(__('&#8220;%s&#8221; has failed to upload due to an error'), esc_html($_FILES['async-upload']['name']) ) . '</strong><br />' .
     50    esc_html($id->get_error_message()) . '</div>';
    4851    exit;
    4952}
     
    5255    // short form response - attachment ID only
    5356    echo $id;
    54 }
    55 else {
     57} else {
    5658    // long form response - big chunk o html
    5759    $type = $_REQUEST['type'];
Note: See TracChangeset for help on using the changeset viewer.