Make WordPress Core

Changeset 34579


Ignore:
Timestamp:
09/26/2015 05:14:08 AM (10 years ago)
Author:
wonderboymusic
Message:

XML-RPC: upgrade the resposnse ofwp_xmlrpc_server::mw_newMediaObject() based on work down in 3.4 so that it runs the struct through ->_prepare_media_item().

Props markoheijnen.
Fixes #6430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r34578 r34579  
    907907            'description'      => $media_item->post_content,
    908908            'metadata'         => wp_get_attachment_metadata( $media_item->ID ),
     909            'type'             => $media_item->post_mime_type
    909910        );
    910911
     
    57715772        do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
    57725773
    5773         $struct = array(
    5774             'id'   => strval( $id ),
    5775             'file' => $name,
    5776             'url'  => $upload[ 'url' ],
    5777             'type' => $upload[ 'type' ]
    5778         );
     5774        $struct = $this->_prepare_media_item( get_post( $id ) );
     5775
     5776        // Deprecated values
     5777        $struct['id']   = $struct['attachment_id'];
     5778        $struct['file'] = $struct['title'];
     5779        $struct['url']  = $struct['link'];
    57795780
    57805781        return $struct;
Note: See TracChangeset for help on using the changeset viewer.