Background of the issue:
I am trying to manage a site with 23 languages using WPML. I've noticed that sometimes the menu breaks 'on its own' due to some background activity. I applied a temporary fix by deactivating some of WPML's hooks, but I'm unsure of the unintended consequences. Here is the temporary fix I applied to the main site: add_action('init', function() { global $wpml_nav_menu; if (isset($wpml_nav_menu->nav_menu_actions)) { remove_action('wp_create_nav_menu', array($wpml_nav_menu->nav_menu_actions, 'wp_update_nav_menu'), 10); remove_action('wp_update_nav_menu', array($wpml_nav_menu->nav_menu_actions, 'wp_update_nav_menu'), 10); remove_action('wp_update_nav_menu_item', array($wpml_nav_menu->nav_menu_actions, 'wp_update_nav_menu_item'), 10); } }, 20);
Symptoms:
Some translated submenu entries are being assigned to the original language menu entry, causing child menu entries to appear as main entries because the parent cannot be located. This issue happens 'on its own' even after running a script to fix it.
Questions:
How can I fix the menu assignment issue without interfering with how the plugin works?