Make WordPress Core

Ticket #6430: 6430.diff

File 6430.diff, 1.1 KB (added by markoheijnen, 11 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    742742                        'caption'          => $media_item->post_excerpt,
    743743                        'description'      => $media_item->post_content,
    744744                        'metadata'         => wp_get_attachment_metadata( $media_item->ID ),
     745                        'type'             => $media_item->post_mime_type
    745746                );
    746747
    747748                $thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
     
    45794580
    45804581                do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
    45814582
    4582                 $struct = array(
    4583                         'id'   => strval( $id ),
    4584                         'file' => $name,
    4585                         'url'  => $upload[ 'url' ],
    4586                         'type' => $type
    4587                 );
     4583
     4584                $struct = $this->_prepare_media_item( get_post( $id ) );
     4585
     4586                // Deprecated values
     4587                $struct['id']   = $struct['attachment_id'];
     4588                $struct['file'] = $struct['title'];
     4589                $struct['url']  = $struct['link'];
     4590
    45884591                return apply_filters( 'wp_handle_upload', $struct, 'upload' );
    45894592        }
    45904593