Opened 5 years ago
Last modified 21 months ago
#34414 new feature request
Add extra item fields to exported WXR file
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4 |
Component: | Export | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
Hello
I am one of WPML developers. WPML is plugin which allows user to make multilingual sites, set language information to posts etc.
Straight to the point: we want to make it available to add to exported posts/pages an information about their language. Language information is stored in our own tables, so we cannot use existing WXR <item> elements like those for taxonomies or custom fields.
It would be perfect if before closing </item> tag would be executed hookable action which will echo those additional elements, coming from plugins such our.
I am attaching proposed patch.
Example of usage:
add_action('wxr_export_item_extra_fields', 'here_wxr_export_item_extra_fields'); function here_wxr_export_item_extra_fields($post) { echo "<testitempost id='" . $post->ID . "' />"; }
Attachments (1)
Change History (7)
#2
@
5 years ago
Hello @swissspidy what could we do to have this patch integrated? I am quite new here
#3
@
5 years ago
- Keywords dev-feedback added
Thanks for pinging me!
I'm really not familiar with import/export stuff, so I would have to leave the decision for others to make here. Unfortunately there's no maintainer for the export component, so it doesn't get the love it deserves. I hope somebody stands up :)
In my opinion a general wxr_export_item_extra_fields
action would be actually quite big as there are no actions currently inside the XML (except for rss2_head
). I worry about people not printing valid XML in there, leading to all sorts of troubles.
For example, echo "<testitempost id='" . $post->ID . "' />";
in your example is lacking some escaping of the post ID.
Proposed patch