Create attachment metadata for xmlrpc uploads. Props mdawaffe. fixes #3452

git-svn-id: http://svn.automattic.com/wordpress/trunk@4628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2006-12-07 22:42:22 +00:00
parent 60fdec501d
commit 3b09e48f19
4 changed files with 122 additions and 124 deletions

View File

@@ -872,7 +872,7 @@ class wp_xmlrpc_server extends IXR_Server {
);
// Save the data
$id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
wp_update_attachment_metadata( $id, array() );
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
return apply_filters( 'wp_handle_upload', array( 'file' => $upload[ 'file' ], 'url' => $upload[ 'url' ], 'type' => $type ) );
}