- Status
- Resolved
Overview of the issue
Languages switcher will ignore wpml-config.xml settings.
Workaround
Fix will be released with WPML 3.1.8. For the time being, you can add this snippet in your theme functions.php:
function temp_init() {
$iteration = 1;
if ( ! is_admin() ) {
return;
}
$temp_init_done = get_transient( 'temp_init_done' );
if ( $iteration !== (int)$temp_init_done ) {
icl_set_setting( 'language_selector_initialized', false );
set_transient( 'temp_init_done', $iteration );
WPML_Config::parse_wpml_config_files();
}
}
add_action( 'init', 'temp_init' );
This code will run only once (or as long as the transient exists).
If you need to parse again the xml file, increase the value of the
$iteration variable.
Once WPML 3.1.8 is released, it is recommended to remove this code.