WordPress.org

Make WordPress Core

Ticket #12740: 12740-3.diff

File 12740-3.diff, 1.5 KB (added by technosailor, 8 years ago)
  • xmlrpc.php

     
    28232823                $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
    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
    28292829        /* MovableType API functions
  • wp-admin/includes/file.php

     
    344344        if ( is_multisite() )
    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
    350350/**
     
    484484        // Compute the URL
    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;
    490490}