[wp-trac] [WordPress Trac] #39021: Import Export Attachments

WordPress Trac noreply at wordpress.org
Fri Dec 2 02:52:11 UTC 2016


#39021: Import Export Attachments
----------------------------+-----------------------------
 Reporter:  LewisCowles     |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:  4.6.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Currently when we export a post type, it seems that the post thumbnails
 are exported as id's. It would be fantastic if these could be exported as
 url's to the images as otherwise there is no way for a separate install to
 import the post data.

 currently, for posts with a thumbnail the below or similar is added to the
 `<item>`
 {{{
                 <wp:postmeta>
 <wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key>
                         <wp:meta_value><![CDATA[9]]></wp:meta_value>
                 </wp:postmeta>
 }}}

 I propose this is moved to `<wp:attachment>` or `<wp:post_thumbnail>` and
 the specific postmeta for `_thumbnail_id` removed from postmeta and re-
 created on each import.

 Problems with my suggestion that I've considered

  * Re-importing (w|c)ould create duplicate media. As the post has to exist
 for post-meta to be added. Maybe using the basename function we could
 check for existing media, maybe it's an edge case... I think this is
 unlikely to be a large problem and it potentially empowers less technical
 users.
  * Some plugins would see no benefit as they use either custom metadata
 keys or multiple attached images (like WooCommerce). I'd suggest this
 could be mitigated by adding a filter of an array of strings that on
 import / export treats a list of fields as keys to treat as thumbnails)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39021>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list