Перейти к содержимому Перейти к боковой панели

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>