summaryrefslogtreecommitdiffstats
path: root/xmlrpc.php
diff options
context:
space:
mode:
Diffstat (limited to 'xmlrpc.php')
-rw-r--r--xmlrpc.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlrpc.php b/xmlrpc.php
index 6718c04..5460121 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -881,8 +881,8 @@ class wp_xmlrpc_server extends IXR_Server {
'guid' => $upload[ 'url' ]
);
// Save the data
- $id = wp_insert_attachment($attachment, $upload[ 'file' ], $post_id);
- add_post_meta($id, '_wp_attachment_metadata', array());
+ $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
+ wp_update_attachment_metadata( $id, array() );
return apply_filters( 'wp_handle_upload', array( 'file' => $upload[ 'file' ], 'url' => $upload[ 'url' ], 'type' => $type ) );
}