Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Import: Attachments #41

Open
4 of 8 tasks
derpixler opened this issue Jan 18, 2016 · 0 comments
Open
4 of 8 tasks

Import: Attachments #41

derpixler opened this issue Jan 18, 2016 · 0 comments
Assignees
Milestone

Comments

@derpixler
Copy link
Contributor

Implement attachment import.

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().

  • 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:
    • Download the file to a temporary file
    • »Handle sideload«
    • 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)
    • delete the temporary file
@derpixler derpixler self-assigned this Jan 18, 2016
@derpixler derpixler added this to the 2.0.0-alpha milestone Jan 18, 2016
dnaber-de added a commit that referenced this issue Jan 18, 2016
@dnaber-de dnaber-de reopened this Jan 29, 2016
dnaber-de added a commit that referenced this issue Jan 29, 2016
parse wp:attachment_url see #41
parse wp:post_author see #37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants