Make WordPress Core


Ignore:
Timestamp:
04/14/2008 11:09:14 PM (16 years ago)
Author:
ryan
Message:

Workaround response truncation by reducing size of response after uploading with flash uploader. Props tellyworth. fixes #6713

File:
1 edited

Legend:

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

    r6830 r7682  
    2121    wp_die(__('You do not have permission to upload files.'));
    2222
     23// just fetch the detail form for that attachment   
     24if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
     25    echo get_media_item($id);
     26    exit;
     27}
     28
    2329$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
    2430if (is_wp_error($id)) {
     
    2733}
    2834
    29 $type = $_REQUEST['type'];
    30 echo apply_filters("async_upload_{$type}", $id);
     35if ( $_REQUEST['short'] ) {
     36    // short form response - attachment ID only
     37    echo $id;
     38}
     39else {
     40    // long form response - big chunk o html
     41    $type = $_REQUEST['type'];
     42    echo apply_filters("async_upload_{$type}", $id);
     43}
    3144
    3245?>
Note: See TracChangeset for help on using the changeset viewer.