Example on how to use wp_handle_sideload(): http://wordpress.stackexchange.com/a/36083/31323 (the answer shows the usage of media_handle_sideload() but the structure of the parameter is identical to the one for wp_handle_sideload().
[x] Update W2M\Import\Type\ImportPostInterface:
namespace W2M\Import\Type;
interface ImportPostInterface {
/**
* ...
*/
/**
* @return string
*/
public function remote_attachment_url();
}
[ ] Implement the new method in W2M\Import\Type\WpImportPost.
[ ] Parse <wp:attachment_url> in W2M\Import\Service\WpPostParser if exists. Propagate an error if it not exists and the post is of type attachment.
[ ] Update W2M\Import\Service\WpPostImporter to handle the file:
[x] Download the file to a temporary file
[ ] »Handle sideload«
[x] Import relevant metadata (but skip these, that pointing to data structures of the remote system like _wp_attached_file if we cannot force a 1:1 mirror of the file paths of the remote system)
Implement attachment import.
Example on how to use
wp_handle_sideload()
: http://wordpress.stackexchange.com/a/36083/31323 (the answer shows the usage ofmedia_handle_sideload()
but the structure of the parameter is identical to the one forwp_handle_sideload()
.W2M\Import\Type\ImportPostInterface
:W2M\Import\Type\WpImportPost
.<wp:attachment_url>
inW2M\Import\Service\WpPostParser
if exists. Propagate an error if it not exists and the post is of typeattachment
.W2M\Import\Service\WpPostImporter
to handle the file:_wp_attached_file
if we cannot force a 1:1 mirror of the file paths of the remote system)