WPML

Overview of the Issue

When using immonex OpenImmo2WP with its OpenImmo2WP Multilang add-on, texts from the site settings show in the default language on translated pages. This affects texts that you translate in WPMLString Translation, for example widget texts and plugin or theme options, on the whole site.

Workaround

  1. Create the file wp-content/mu-plugins/openimmo2wp-multilang-strings.php.
  2. Add this code and save:
    PHP
    <?php
    add_action( 'wp_loaded', function () {
    	global $wp_filter;
    	if ( empty( $wp_filter['icl_current_string_language'] ) ) { return; }
    	foreach ( $wp_filter['icl_current_string_language']->callbacks as $prio => $cbs ) {
    		foreach ( $cbs as $cb ) {
    			if ( is_array( $cb['function'] ) && is_object( $cb['function'][0] )
    				&& 0 === strpos( get_class( $cb['function'][0] ), 'immonex\OpenImmo2WpMultilang' ) ) {
    				remove_filter( 'icl_current_string_language', $cb['function'], $prio );
    			}
    		}
    	}
    }, 1 );

Translated pages then show the translated texts again. Imports keep working.

All known issues

Need Help with This Issue?

Ask a support question and we’ll look into it with you.