XML-RPC: upgrade the resposnse of`wp_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. Built from https://develop.svn.wordpress.org/trunk@34579 git-svn-id: http://core.svn.wordpress.org/trunk@34543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e9aa518f04
commit
80ac048cbc
|
@ -906,6 +906,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
'caption' => $media_item->post_excerpt,
|
||||
'description' => $media_item->post_content,
|
||||
'metadata' => wp_get_attachment_metadata( $media_item->ID ),
|
||||
'type' => $media_item->post_mime_type
|
||||
);
|
||||
|
||||
$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
|
||||
|
@ -5770,12 +5771,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
*/
|
||||
do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
|
||||
|
||||
$struct = array(
|
||||
'id' => strval( $id ),
|
||||
'file' => $name,
|
||||
'url' => $upload[ 'url' ],
|
||||
'type' => $upload[ 'type' ]
|
||||
);
|
||||
$struct = $this->_prepare_media_item( get_post( $id ) );
|
||||
|
||||
// Deprecated values
|
||||
$struct['id'] = $struct['attachment_id'];
|
||||
$struct['file'] = $struct['title'];
|
||||
$struct['url'] = $struct['link'];
|
||||
|
||||
return $struct;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34578';
|
||||
$wp_version = '4.4-alpha-34579';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue