Chuyển đến nội dung Chuyển đến thanh bên

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the WPRentals theme with WPML, you might experience an issue where taxonomy terms on property pages appear in the wrong language. This occurs because the theme caches taxonomy data, causing terms to display in the last language where the cache was cleared.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/themes/wprentals/libs/taxonomy_functions/taxonomy_transients_functions.php file.
  • Look for line 35.
  • Replace:
    // Create unique key based on taxonomy and args
    $args_hash = md5(serialize($args));
            
  • With:
    // Create unique key based on taxonomy and args
    $args_hash = md5(serialize($args));
    // WPML Workaround for compsupp-8069 
    if ( class_exists('Sitepress') ) { 
        $current_lang = apply_filters( 'wpml_current_language', NULL ); 
        $args_hash .= '_' . $current_lang;
    }
            

This will append the current language code to the transient key, ensuring that each language has its own cached taxonomy terms.

Để lại trả lời

Vui lòng giữ đúng chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi vé hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>