WordPress.org

Make WordPress Core

Changeset 14418


Ignore:
Timestamp:
05/03/2010 10:16:48 PM (12 years ago)
Author:
nacin
Message:

Provide a context to wp_handle_upload to differentiate between upload and sideload. props technosailor, fixes #12740.

Location:
trunk
Files:
2 edited

Legend:

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

    r14404 r14418  
    345345        delete_transient( 'dirsize_cache' );
    346346
    347     return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
     347    return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' );
    348348}
    349349
     
    485485    $url = $uploads['url'] . "/$filename";
    486486
    487     $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
     487    $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'sideload' );
    488488
    489489    return $return;
  • trunk/xmlrpc.php

    r14315 r14418  
    28242824        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
    28252825
    2826         return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) );
     2826        return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ), 'upload' );
    28272827    }
    28282828
Note: See TracChangeset for help on using the changeset viewer.