Opened 15 months ago

Last modified 15 months ago

#20206 new enhancement

WXR unnecessarily includes all post authors

Reported by: johnbillion Owned by:
Priority: normal Milestone: Awaiting Review
Component: Export Version: 3.3
Severity: normal Keywords: has-patch
Cc: jeremy.felt@…

Description

If you're exporting just one post type (from Tools -> Export), the resulting WXR file still includes all authors from the posts table, regardless if they are the author of a post of the post type being exported. This can be particularly noticable for Pages (which are often only authored by a small number of different users on the site) and for custom post types.

This means when you subsequently import the file you'll be asked to map a complete list of all authors from the exported site, even if they have no posts in the WXR file being imported.

Attachments (2)

20206.patch (1.6 KB) - added by johnbillion 15 months ago.
20206.2.diff (1.3 KB) - added by jeremyfelt 15 months ago.
Updated patch using $post_ids

Download all attachments as: .zip

Change History (5)

  • Keywords has-patch added

Patch to only include relevant post authors in the WXR export.

  • Cc jeremy.felt@… added

I really like this idea. It makes sense to export all of the data based on the selected parameters.

It may make more sense to reuse the $post_ids array so that the query for distinct post authors mirrors the results from the main posts query. Restricting it to post_type could cause the same issue with extra authors for some taxonomies, etc...

The updated patch attached uses the $post_ids array instead.

Updated patch using $post_ids

Even better!

Note: See TracTickets for help on using tickets.