[wp-trac] [WordPress Trac] #52470: Exported WXR contains terms twice

WordPress Trac noreply at wordpress.org
Mon Feb 8 16:31:25 UTC 2021


#52470: Exported WXR contains terms twice
--------------------------+-----------------------------
 Reporter:  karl94        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

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


More information about the wp-trac mailing list