WPML

Overview of the Issue

Sometimes, not all menus that exist in your site will be listed in the dialog to add a language switcher to a menu. Additionally, the language switcher is missing in the menu of secondary language.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

This issue occurs with old installs where the term_id is not always equal to the term_taxonomy_id.

The problem will be fixed in a future release. Meanwhile, it is possible to manually patch the currently released version.

Step 1

Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-settings.php on the line 267 and replace:

$menu_details = $this->sitepress->get_element_language_details( $menu->term_id, 'tax_nav_menu' );

With:

$menu_details = $this->sitepress->get_element_language_details( $menu->term_taxonomy_id, 'tax_nav_menu' );

Step 2

Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-menu-element.php on line 27 and replace:

return new WPML_Menu_Element( $element_data->element_id, $this->sitepress, $this->wpml_cache );

With:

return new WPML_Menu_Element( $element_data->term_id, $this->sitepress, $this->wpml_cache );

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.

Ask a support question

All known issues