Opened 5 years ago
Last modified 2 years ago
#52470 new defect (bug)
Exported WXR contains terms twice
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Export | Keywords: | has-patch |
| Focuses: | Cc: |
Description
How to reproduce: after a fresh WordPress install (no active plugins) go make a WXR export file. If you open the WRX file you'll notice the Uncategorized appears twice: the first time as wp:category element, the second as a wp:term.
The wp:category comes from https://github.com/WordPress/WordPress/blob/5.6.1/wp-admin/includes/export.php#L158, the wp:term from https://github.com/WordPress/WordPress/blob/5.6.1/wp-admin/includes/export.php#L162-L167. With the setup described (no plugins) the only registered taxonomies are the builtin ones, therefore $custom_taxonomies contains an empty array. When get_terms() receives an empty array as the taxonomies param it will return all terms, of every taxonomy.
This also means that if there are other taxonomies registered the issue doesn't show up.
This is a regression: on WordPress 4.4 it doesn't happen.
A git bisect pointed to https://github.com/WordPress/WordPress/commit/3f7441d674d304a8ad0912831aa9685cdc8bff93 as the culprit.
The commit states that it maintains backwards compatibility, but it does not in case an empty array is passed as taxonomy param.
Removing
trunkas the Version as predates 5.7 (currenttrunk). Actual trunk can be set once root cause is identified.