Opened 14 years ago
Closed 14 years ago
#14750 closed feature request (fixed)
Add menus, menu items to import and export
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Import | Keywords: | dev-feedback |
Focuses: | Cc: |
Description (last modified by )
Export
Menus and their menu items should be included in the WXR. Switching can_export to true should mostly rectify this.
However, that introduces some issues. Including them in the post type and taxonomy dropdowns is not intuitive. You either need to export everything, or just export the menu tax and item PT (and you need to know to select both). Not every post type is going to be "content" that belongs in the dropdown, but that doesn't mean it shouldn't be somehow portable. (Same with taxonomies.)
Thus to me it makes sense that can_export might need to be split into A) showing it in the export UI, and B) can it be included in the WXR file. We can then handle our own UI, perhaps with a checkbox, "Export menus." Or something.
That of course brings up another concern, which is that menu items have associated posts, which means they need to also be exported. So really you should not be able to export just menus and menu items, unless of course all of your menu items are custom links (but how can we know that?). Ironically, a simplified export.php from 2.9 would have served us well here, as we'd always just export everything.
Import
Offering a patch for import is particularly challenging, because we'll not only need to map the post-taxonomy relationships (which the importer should handle for menus out of the box) but also the relationships between a menu item and the associated post or term. That introduces new problems. What happens when the associated post or term is not included in the WXR file? Does the menu item convert to a custom link? (Is there any indication that it became broken on import?) Or do we decline to import the menu item? (What about children menu items?)
Clearly a lot of questions here. I think it is pretty safe to say that we do want menus exportable (they are much more like content than basic settings), but the implementation will not be easy.
Suggestions and patches strongly welcome.
Change History (6)
#6
@
14 years ago
- Resolution set to fixed
- Status changed from new to closed
(In [15961]) Importer and exporter overhaul, mega props duck.
Exporter overhaul:
- Add author information to export
- Greater usage of slug identifiers
- Don't export auto-drafts, spam comments, or edit lock/last meta keys
- Inline documentation improvements
- Remove filtering for now (@todo)
- Bump WXR version to 1.1, but remain back compat in the importer
Importer overhaul (http://plugins.trac.wordpress.org/changeset/304249):
- Use an XML parser where available (SimpleXML, XML Parser)
- Proper import support for navigation menus
- Many bug fixes, specifically improvements to category and custom taxonomy handling
- Better author/user mapping
Fixes #5447 #5460 #7400 #7973 #8471 #9237 #10319 #11118 #11144 #11354 #11574 #12685 #13364 #13394 #13453 #13454 #13627 #14306 #14442 #14524 #14750 #15055 #15091 #15108.
See #15197.
I did some digging around and found the following:
The above results in the following when imported via the core WordPress Importer plugin
This means that all we have to do to get nav menus exporting / importing correctly when all content types are selected during export process is to a) Tweak export script to add the nav_menu to the nav_menu_items and b) tweak the import plugin to set those relationships correctly.
Seems like this should be corrected before tackling user specified options. Thoughts?