• Resolved IvanRF

    (@ivanrf)


    I have an issue with WPML and W3 Total Cache, but I don’t know where is the problem. I will start with the example code:

    $spanish = get_option( 'option_name' );
    global $sitepress;
    $sitepress->switch_lang('en');
    $english = get_option( 'option_name' );

    Object cache and Database cache is enabled.

    The problem is that my second call to get_option takes the value of the first call. So, what should be in English, is in Spanish. It is a caching issue, but I don’t know how to avoid it.

    I modified in the database autoload to no for this option, emptied all caches, but still the second call gets the first value.

    What should I do?

    https://wordpress.org/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter IvanRF

    (@ivanrf)

    Any ideas???

    I long ago ran into issues with WPML when Database caching is on.

    I had to turn it off.

    I just use object cache and page cache now.

    Rich

    Thread Starter IvanRF

    (@ivanrf)

    This was caused by a bug in WPML String Translation, I’m so angry!

    When get_option applies the filter 'option_' . $option, the function icl_st_translate_admin_string in wpml-string-translation/inc/admin-texts/wpml-admin-texts.class.php is called. This class has an internal cache $icl_st_cache and there was the issue. This cache is not taking into account that the language was changed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Object cache and i18n issue’ is closed to new replies.