跳转至内容 跳转至侧边栏

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.

发表回复

保持话题相关并尊重他人。如果您需要与本帖无关的问题帮助,请使用我们的支持论坛开始聊天或提交工单。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>