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,
|
'caption' => $media_item->post_excerpt,
|
||||||
'description' => $media_item->post_content,
|
'description' => $media_item->post_content,
|
||||||
'metadata' => wp_get_attachment_metadata( $media_item->ID ),
|
'metadata' => wp_get_attachment_metadata( $media_item->ID ),
|
||||||
|
'type' => $media_item->post_mime_type
|
||||||
);
|
);
|
||||||
|
|
||||||
$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );
|
$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 );
|
do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
|
||||||
|
|
||||||
$struct = array(
|
$struct = $this->_prepare_media_item( get_post( $id ) );
|
||||||
'id' => strval( $id ),
|
|
||||||
'file' => $name,
|
// Deprecated values
|
||||||
'url' => $upload[ 'url' ],
|
$struct['id'] = $struct['attachment_id'];
|
||||||
'type' => $upload[ 'type' ]
|
$struct['file'] = $struct['title'];
|
||||||
);
|
$struct['url'] = $struct['link'];
|
||||||
|
|
||||||
return $struct;
|
return $struct;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue