Mega Menu With One Click Importer theme , Importer will not work Now

Hi , guys i notice a bug , i think its a bug in the Wordpress Importer , Developers who created Mega Menu Options by adding Post meta Fields

like this

$menu_item->anchor = get_post_meta( $menu_item->ID, '_menu_item_anchor', true );

add_filter( 'wp_setup_nav_menu_item', 'miller_add_custom_nav_fields' );

// save menu custom fields

add_action( 'wp_update_nav_menu_item', 'miller_update_custom_nav_fields', 10, 3 );

Wordpress Importer is not going to Save these Values On the time Of Importer Even they are in the XML File
i was thinking its a bug in my theme then i create a blank theme and extend the twentyforty default theme too , but postmeta tags only related to these files is not importing ,

but they are saving and working manually but its a problem to the developers who providing the theme with one click installer

I hope a update will available soon for this i try the stockholm theme too, its also not working with custom meta field

WordPress Importer plugin imports and exports only default meta fields for menu items, so if you want to use it for your demo importer you need some tweaks.

but the Fields and the value is in the xml file
and i am coder to can you please help me with this ,

i just let u know they are saving and working well manually but in the time of import they are not importing ?

i suggest you to check your theme

the importer will definitely will not work now with the meta field of mega menus

We’re aware of this issue so we’ve already put such tweak to wordpress importer in our framework :smile:

would you like to help me and other :slight_smile:
please :slight_smile:

You have to change process_menu_item() function in wordpress-importer.php. Set meta values using update_post_meta() function.

i don;t think you have any solution :stuck_out_tongue: because there is only one way to import the attachments
through the import function wp_importer and its not updating the fields
if he update the field its not going to give the corrent id of post to them
because on the time of import wordpress give a unique id to that post
and post meta getting the different id

If you really have a solution you should share with us

but if you want i can buy your theme if you really have a solution please tell me

i wanna learn

Please look at the code of process_menu_item() function in wordpress-importer.php. This function is responsible of importing menu item, and is called for each menu items. I’m not sure what you’re talking about but please look into the logic of wordpress importer plugin deeply. I told you the solution we’re already using now.

so if i buy your theme its defiantly there tell me i wanna learn

I’m not saying you have to buy our theme, but you need to look into the logic of the function I mentioned. It calls wp_update_nav_menu_item() function to update menu item meta fields, but the problem is that this function only updates standard meta fields only. That’s why you have to add the code that will also update custom metas. update_post_meta() function will be used for that purpose.