From 80ac048cbc1ab9e319c79b4e521936976949f6cb Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 26 Sep 2015 05:15:25 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-xmlrpc-server.php | 13 +++++++------ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index cd49de564e..14668cdc47 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index aa2a5565d5..2ffba30c74 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.