Skip to content

Conversation

@BackuPs
Copy link

@BackuPs BackuPs commented Oct 17, 2025

Please change the code so custom menu meta data also gets imported.

@adamziel
Copy link
Contributor

Hey @BackuPs, thank you for the PR! I'm missing the relevant context that would help me review your work, would you mind sharing what's different before and after this PR? And also what's the best way to test it?

@BackuPs
Copy link
Author

BackuPs commented Oct 20, 2025

@adamziel Hi Adam,

I am sorry i was not clear enough. I am talking about the new abilities added in wordpress .5.4 as described here.

https://make.wordpress.org/core/2020/02/25/wordpress-5-4-introduces-new-hooks-to-add-custom-fields-to-menu-items/

Please read the comments to that article as well.

Wordpress allows you to create new custom menu settings but the wordpress importer does not connect them to the menu item. It only does so for the default menu item settings. Below part of the code class-wp-import.php

afbeelding

The fields / settings added by users are completely ignored by the importer. So exporting and creating a xml file results in a correct file. But at import they are lost and one has to re-enter them allover again.

Below a example of custom fields added.

afbeelding

The suggested code change restores and adds the custom fields to the corresponding menu item.

A ticket from 12 years ago describes the issue already https://plugins.trac.wordpress.org/ticket/1678

https://make.wordpress.org/core/2020/02/25/wordpress-5-4-introduces-new-hooks-to-add-custom-fields-to-menu-items/#comment-38027

I hope this provides you enough information to understand what i am trying to do. If not please get back to me and i will try to explain better.

Thank You
BackuPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants