- Status
- Resolved
- Reported for
- WPML Multilingual CMS 3.6.1
- Resolved in
- 3.6.1
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 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 );