Make WordPress Core

Opened 7 years ago

Last modified 2 months ago

#47446 assigned enhancement

Tools > Export does not include term meta data for a custom post type

Reported by: mclaurent Owned by:
Priority: normal Milestone: Awaiting Review
Component: Export Version: 5.2.1
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by sabernhardt)

Steps:

  1. Register a public custom post type
  2. Register a custom taxonomy with a custom term_meta
  3. populate with dummy posts, terms and term meta values
  4. go to tools > export and select your custom post type
  5. The resulting XML is perfectly valid and includes all posts along with the terms of the taxonomy. Observe that none of the terms have their corresponding term_meta

Expected:
When exporting content of one custom post type, the term_meta should be included.

Solution:
I have not found one. Looking at wp-admin/includes/export.php:148 I can see that $terms is only populated when $args['content'] is set to all ("All Content"). Here the source I am referring to: ​https://github.com/WordPress/WordPress/blob/5.2.1/wp-admin/includes/export.php#L148

Environment: WP 5.2.1, WAMP, PHP7.2

Change History (1)

#1 @sabernhardt
2 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.